Skip to content

Commit

Permalink
Update Vitepress config to improve sidebar options and resolve path f…
Browse files Browse the repository at this point in the history
…or the database sidebar option
  • Loading branch information
Leetfs committed Sep 7, 2024
1 parent f40d8d0 commit 08ce53a
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,54 @@ const nav = [
},
{
text: '贡献指南',
items: [
items: [ // 确保 items 是一个数组
{
text: '课程资料投稿指南',
link: '/contributor-guide/campus.md',
link: '/contributor-guide/campus',
},
{
text: '其他投稿指南',
link: '/contributor-guide/other.md',
link: '/contributor-guide/other',
},
{
text: '课程贡献模板',
link: '/contributor-guide/CampusTemplate.md',
link: '/contributor-guide/CampusTemplate',
},
],
},
]

// 侧边栏配置项
// 侧边栏配置
const sidebar = {
'/sql/': [
{ text: 'SQL 入门', link: '/sql/' },
{ text: 'SQL', link: '/sql/' },
],
'/contributor-guide/': [
{ text: '投稿指南', link: '/contributor-guide/campus.md' },
{ text: '其他投稿', link: '/contributor-guide/other.md' },
{ text: '其他投稿指南', link: '/contributor-guide/other.md' },
{ text: '贡献模板', link: '/contributor-guide/CampusTemplate.md' },
],
'/web/': [
{ text: 'HTML', link: '/web/' },
{ text: 'WEB', link: '/web/' },
],
'/computer/': [
{ text: '计算机原理', link: '/computer/' },
{ text: '计算机基础', link: '/computer/' },
],
'/others/': [
{ text: '其他内容', link: '/others/' },
],
}

// 主题配置项
// 主题配置
const themeConfig = {
siteTitle: 'study-wiki',
description: '一份 课程 指南',
/** GitHub 仓库链接 */
description: '一份课程指南',
nav, // 导航栏
sidebar, // 侧边栏
githubRepoLink: 'https://github.com/Leetfs/study-wiki',
/** 导航栏 */
nav,
/** 侧边栏 */
sidebar,
}

// VitePress 配置
export default defineConfig({
themeConfig, // 将 themeConfig 作为主题配置传入
themeConfig,
})

0 comments on commit 08ce53a

Please sign in to comment.