diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index c15fb487..08a5bf77 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -20,19 +20,28 @@ module.exports = { ], sidebar: { - '/guide/': [ - { - text: 'Introduction', - children: [ - { text: 'What is VitePress?', link: '/' }, - { text: 'Getting Started', link: '/guide/getting-started' }, - { text: 'Configuration', link: '/guide/configuration' }, - { text: 'Customization', link: '/guide/customization' }, - { text: 'Deploying', link: '/guide/deploy' } - ] - } - ], - '/config/': [{ text: 'Config Reference', link: '/config/' }] + '/': getGuideSidebar(), + '/guide/': getGuideSidebar(), + '/config/': getConfigSidebar() } } } + +function getGuideSidebar() { + return [ + { + text: 'Introduction', + children: [ + { text: 'What is VitePress?', link: '/' }, + { text: 'Getting Started', link: '/guide/getting-started' }, + { text: 'Configuration', link: '/guide/configuration' }, + { text: 'Customization', link: '/guide/customization' }, + { text: 'Deploying', link: '/guide/deploy' } + ] + } + ] +} + +function getConfigSidebar() { + return [{ text: 'Config Reference', link: '/config/' }] +}