diff --git a/gatsby-node.js b/gatsby-node.js index 6757484..5bf35c7 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -93,8 +93,18 @@ const fromSourceConfig = config => { }, nav); }; +// Pulls sources with a key of '/' up to the root-level navigation. +const hoistRoot = nav => ({ + ...nav, + children: nav.children.flatMap((child) => { + if (child.key === '/') return child.children; + return child; + // Removes the "Home" route from nav. + }).filter(({ page }) => !page || page.pathname !== '/'), +}); + exports.onPostBootstrap = function cacheSourceData() { - const navigation = fromSourceConfig(sources); + const navigation = hoistRoot(fromSourceConfig(sources)); const json = JSON.stringify({ sources, navigation }); const jsonPath = path.join(__dirname, '.cache/__farmOS__source_data.json'); fs.writeFileSync(jsonPath, json); diff --git a/source-repos.js b/source-repos.js index 9cd5074..b2b5021 100644 --- a/source-repos.js +++ b/source-repos.js @@ -2,7 +2,7 @@ module.exports = [ { name: 'farmOS', title: 'farmOS 2.x Docs', - baseURI: '/docs', + baseURI: '/', mkdocs: 'mkdocs.yml', remote: 'https://github.com/farmOS/farmOS.git', branch: '2.x', @@ -11,7 +11,7 @@ module.exports = [ { name: 'farmOS.js', title: 'farmOS.js', - parentPath: '/docs/development', + parentPath: '/development', baseURI: '/farmos-js', mkdocs: 'docs/config.yml', remote: 'https://github.com/farmOS/farmOS.js.git', @@ -21,7 +21,7 @@ module.exports = [ { name: 'farmOS.py', title: 'farmOS.py', - parentPath: '/docs/development', + parentPath: '/development', baseURI: '/farmos-py', mkdocs: 'docs/config.yml', remote: 'https://github.com/farmOS/farmOS.py.git', diff --git a/src/content/config.yml b/src/content/config.yml index eed10a6..ff116f4 100644 --- a/src/content/config.yml +++ b/src/content/config.yml @@ -14,4 +14,4 @@ nav: - Supporters: community/supporters.md - Press: community/press.md - Trademark: community/trademark.md -- Donate: donate.md + - Donate: donate.md