mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-19 06:19:27 +00:00
fix build issues
This commit is contained in:
parent
f46bdc3e1a
commit
14900bcdfa
4 changed files with 2780 additions and 2843 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: JavaScript Console 2: Contracts
|
title: 'JavaScript Console 2: Contracts'
|
||||||
description: Instructions for working with contracts in the Javascript console.
|
description: Instructions for working with contracts in the Javascript console.
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -30,11 +30,11 @@
|
||||||
"react-syntax-highlighter": "^15.5.0"
|
"react-syntax-highlighter": "^15.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/js-yaml": "^4.0.5",
|
||||||
"@types/node": "18.7.16",
|
"@types/node": "18.7.16",
|
||||||
"@types/react": "18.0.18",
|
"@types/react": "18.0.18",
|
||||||
"@types/react-dom": "18.0.6",
|
"@types/react-dom": "18.0.6",
|
||||||
"@types/react-syntax-highlighter": "^15.5.5",
|
"@types/react-syntax-highlighter": "^15.5.5",
|
||||||
"@types/js-yaml": "^4.0.5",
|
|
||||||
"eslint": "8.23.0",
|
"eslint": "8.23.0",
|
||||||
"eslint-config-next": "12.2.5",
|
"eslint-config-next": "12.2.5",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export const getStaticPaths: GetStaticPaths = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return files.map(file => file.replace('.md', '')).map((file) => file.replace('/index', ''));
|
return files.map(file => file.replace('.md', '')).map(file => file.replace('/index', ''));
|
||||||
};
|
};
|
||||||
|
|
||||||
const paths: string[] = getFileList('docs'); // This is folder that get crawled for valid docs paths. Change if this path changes.
|
const paths: string[] = getFileList('docs'); // This is folder that get crawled for valid docs paths. Change if this path changes.
|
||||||
|
|
@ -40,16 +40,14 @@ export const getStaticPaths: GetStaticPaths = () => {
|
||||||
|
|
||||||
// Reads file data for markdown pages
|
// Reads file data for markdown pages
|
||||||
export const getStaticProps: GetStaticProps = async context => {
|
export const getStaticProps: GetStaticProps = async context => {
|
||||||
const { slug } = context.params as ParsedUrlQuery
|
const { slug } = context.params as ParsedUrlQuery;
|
||||||
const filePath = (slug as string[])!.join('/')
|
const filePath = (slug as string[])!.join('/');
|
||||||
let file
|
let file;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
file = fs
|
file = fs.readFileSync(`${filePath}.md`, 'utf-8');
|
||||||
.readFileSync(`${filePath}.md`, 'utf-8')
|
|
||||||
} catch {
|
} catch {
|
||||||
file = fs
|
file = fs.readFileSync(`${filePath}/index.md`, 'utf-8');
|
||||||
.readFileSync(`${filePath}/index.md`, 'utf-8')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data: frontmatter, content } = matter(file, MATTER_OPTIONS);
|
const { data: frontmatter, content } = matter(file, MATTER_OPTIONS);
|
||||||
|
|
@ -72,15 +70,9 @@ interface Props {
|
||||||
const DocPage: NextPage<Props> = ({ frontmatter, content }) => {
|
const DocPage: NextPage<Props> = ({ frontmatter, content }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Heading as='h1'>
|
<Heading as='h1'>{frontmatter.title}</Heading>
|
||||||
{frontmatter.title}
|
|
||||||
</Heading>
|
|
||||||
|
|
||||||
<ReactMarkdown
|
<ReactMarkdown components={MDXComponents}>{content}</ReactMarkdown>
|
||||||
components={MDXComponents}
|
|
||||||
>
|
|
||||||
{content}
|
|
||||||
</ReactMarkdown>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue