From f40d8d006e81499452451a20efc4b53e612c43b9 Mon Sep 17 00:00:00 2001 From: LeeGuanLi Date: Sat, 7 Sep 2024 11:23:35 +0800 Subject: [PATCH] Update Vitepress config to improve sidebar options --- docs/.vitepress/config.ts | 52 +++++++++++++++------------------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index fd0bbc9..013930c 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -38,38 +38,26 @@ const nav = [ }, ] - -const sidebarOptions = [ - // 数据库 - { - ...baseConfig, - scanStartPath: 'sql', - }, - // 贡献指南 - { - ...baseConfig, - scanStartPath: 'contributor-guide', - resolvePath: '/contributor-guide/', - }, - // 网页 - { - ...baseConfig, - scanStartPath: 'web', - resolvePath: '/web/', - }, - // 计算机基础 - { - ...baseConfig, - scanStartPath: 'computer', - resolvePath: '/computer/', - }, - // 其它 - { - ...baseConfig, - scanStartPath: 'others', - resolvePath: '/others/', - }, - ] +// 侧边栏配置项 +const sidebar = { + '/sql/': [ + { text: 'SQL 入门', link: '/sql/' }, + ], + '/contributor-guide/': [ + { text: '投稿指南', link: '/contributor-guide/campus.md' }, + { text: '其他投稿', link: '/contributor-guide/other.md' }, + { text: '贡献模板', link: '/contributor-guide/CampusTemplate.md' }, + ], + '/web/': [ + { text: 'HTML', link: '/web/' }, + ], + '/computer/': [ + { text: '计算机原理', link: '/computer/' }, + ], + '/others/': [ + { text: '其他内容', link: '/others/' }, + ], +} // 主题配置项 const themeConfig = {