Skip to content

Commit 6f17bb6

Browse files
committed
Remove copy docs step and reorder menu links
1 parent 0788d9f commit 6f17bb6

File tree

3 files changed

+5
-102
lines changed

3 files changed

+5
-102
lines changed

docs/config/gatsby-config.js

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
1-
const fs = require('fs');
2-
const path = require('path');
3-
4-
// Function to get markdown files and create menu links
5-
function getMenuLinksFromDocs() {
6-
const docsPath = path.join(__dirname, 'src/docs');
7-
const menuLinks = [];
8-
9-
try {
10-
const files = fs.readdirSync(docsPath);
11-
files.forEach(file => {
12-
if (file.endsWith('.md') || file.endsWith('.mdx')) {
13-
const name = file.replace(/\.(md|mdx)$/, '').replace(/-/g, ' ');
14-
const link = `/${file.replace(/\.(md|mdx)$/, '')}`;
15-
menuLinks.push({
16-
name: name.charAt(0).toUpperCase() + name.slice(1),
17-
link: link
18-
});
19-
}
20-
});
21-
} catch (error) {
22-
console.warn('Could not read docs directory:', error.message);
23-
}
24-
25-
return menuLinks;
26-
}
27-
281
module.exports = {
292
pathPrefix: "/execution-apis",
303
siteMetadata: {
@@ -38,11 +11,13 @@ module.exports = {
3811
secondaryColor: '#f50057', //material-ui secondary color
3912
author: '',
4013
menuLinks: [
14+
{ name: 'Intro', link: '/intro' },
4115
{
4216
name: 'API Documentation',
4317
link: '/api-documentation'
4418
},
45-
...getMenuLinksFromDocs() // This will add all markdown files
19+
{ name: 'Making changes', link: '/making-changes' },
20+
{ name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' },
4621
],
4722
footerLinks: [
4823
{
@@ -93,7 +68,7 @@ module.exports = {
9368
resolve: "gatsby-source-filesystem",
9469
options: {
9570
name: "docs",
96-
path: __dirname + '/src/docs',
71+
path: __dirname + '/../../../docs/reference',
9772
},
9873
},
9974
],

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"build": "npm run build:spec",
88
"build:spec": "node scripts/build.js",
99
"build:docs": "npm run generate-clients && npm run build:docs:gatsby",
10-
"build:docs:gatsby": " npm run copy-docs && cd build/docs/gatsby && npm install && gatsby build --prefix-paths",
10+
"build:docs:gatsby": "cp docs/config/gatsby-config.js build/docs/gatsby && cd build/docs/gatsby && npm install && gatsby build --prefix-paths",
1111
"lint": "node scripts/build.js && node scripts/validate.js && node scripts/graphql-validate.js",
1212
"clean": "rm -rf build && mkdir -p build",
13-
"copy-docs": "node scripts/prepare-docs.js",
1413
"generate-clients": "mkdir -p build && open-rpc-generator generate -c open-rpc-generator-config.json",
1514
"graphql:schema": "node scripts/graphql.js",
1615
"graphql:validate": "node scripts/graphql-validate.js",

scripts/prepare-docs.js

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)