1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

feat: 构建文档基础框架

This commit is contained in:
2025-02-21 00:13:26 +08:00
parent ec9656071f
commit 8820544319
10 changed files with 159 additions and 11 deletions

View File

@@ -1,11 +1,70 @@
import { DefaultTheme } from 'vitepress'
export const sidebar: DefaultTheme.Sidebar = [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
const serialNumberMap = {}
function serial(key) {
if (!serialNumberMap[key]) {
serialNumberMap[key] = 0
}
]
const serialNumber = ++serialNumberMap[key] // `${++serialNumberMap[key]}. `
// return
if (!key.includes('.')) {
return `🌟 `
}
return ``
}
export const sidebar: DefaultTheme.Sidebar = {
'/how-to/': {
base: '/how-to/',
items: [
{
text: '开始',
items: [
{
text: '教程简介',
link: '/index.md',
},
]
},
{
text: 'Linux 系统如何 ... ?',
items: [
{
text: `${serial('linux')}安装数据库`,
items: [
{
text: `${serial('linux.db')}MySQL 8.x 安装 & 配置 (Ubuntu)`,
link: 'database/mysql/install-on-ubuntu.md',
}
]
},
]
},
{
text: 'Windows 系统如何 ... ?',
items: [
{
text: `${serial('win')}安装数据库`,
items: [
{
text: `${serial('win.db')}MySQL 8.x 安装 & 配置`,
link: 'database/mysql/install-on-windows.md',
}
]
},
]
},
]
},
'/': [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
]
}