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 ( / \. ( m d | m d x ) $ / , '' ) . replace ( / - / g, ' ' ) ;
14- const link = `/${ file . replace ( / \. ( m d | m d x ) $ / , '' ) } ` ;
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-
281module . 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 ] ,
0 commit comments