2024-06-24 00:14:35 +08:00
|
|
|
|
import genConfig from '@project-trans/vitepress-theme-project-trans/config'
|
|
|
|
|
import type { SidebarOptions } from '@project-trans/vitepress-theme-project-trans/theme'
|
|
|
|
|
import type { ThemeContext } from '@project-trans/vitepress-theme-project-trans/utils'
|
|
|
|
|
import { withThemeContext } from '@project-trans/vitepress-theme-project-trans/utils'
|
|
|
|
|
import type { DefaultTheme } from 'vitepress'
|
|
|
|
|
|
|
|
|
|
type NavConfig = DefaultTheme.Config['nav']
|
|
|
|
|
|
|
|
|
|
const nav: NavConfig = [
|
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "大学指南",
|
|
|
|
|
link: "/campus/",
|
2023-12-01 16:15:58 +08:00
|
|
|
|
},
|
2024-06-24 00:14:35 +08:00
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "时尚护理",
|
|
|
|
|
link: "/fashion/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "安全防护",
|
|
|
|
|
link: "/personal-safety/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
2024-10-05 00:25:04 +08:00
|
|
|
|
{
|
|
|
|
|
text: "志愿填报",
|
|
|
|
|
link: "/admission/",
|
|
|
|
|
},
|
2024-06-24 00:14:35 +08:00
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "海外生活",
|
|
|
|
|
link: "/overseas/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "其它",
|
|
|
|
|
link: "/others/",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: "贡献指南",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
items: [
|
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "校园版块投稿指南",
|
|
|
|
|
link: "/contributor-guide/campus.md",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "其他投稿指南",
|
|
|
|
|
link: "/contributor-guide/other.md",
|
2023-12-21 23:43:18 +08:00
|
|
|
|
},
|
2024-06-24 00:14:35 +08:00
|
|
|
|
{
|
2024-10-05 00:02:43 +08:00
|
|
|
|
text: "校园版块贡献模板",
|
|
|
|
|
link: "/contributor-guide/CampusTemplate.md",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
],
|
2023-12-21 23:43:18 +08:00
|
|
|
|
},
|
2024-10-05 00:02:43 +08:00
|
|
|
|
];
|
2024-06-24 00:14:35 +08:00
|
|
|
|
|
|
|
|
|
const baseConfig = {
|
|
|
|
|
useTitleFromFrontmatter: true,
|
|
|
|
|
useFolderTitleFromIndexFile: true,
|
|
|
|
|
useFolderLinkFromIndexFile: true,
|
|
|
|
|
excludeFilesByFrontmatterFieldName: true,
|
|
|
|
|
collapsed: true,
|
|
|
|
|
documentRootPath: '/docs',
|
|
|
|
|
} satisfies Partial<SidebarOptions>
|
|
|
|
|
|
|
|
|
|
const sidebarOptions = [
|
|
|
|
|
// 大学指南
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
2024-10-05 00:25:04 +08:00
|
|
|
|
scanStartPath: "campus",
|
|
|
|
|
resolvePath: "/campus/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
// 贡献指南
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
2024-10-05 00:25:04 +08:00
|
|
|
|
scanStartPath: "contributor-guide",
|
|
|
|
|
resolvePath: "/contributor-guide/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
|
|
|
|
// 时尚护理
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
2024-10-05 00:25:04 +08:00
|
|
|
|
scanStartPath: "fashion",
|
|
|
|
|
resolvePath: "/fashion/",
|
2024-04-12 07:11:45 +08:00
|
|
|
|
},
|
2024-06-24 00:14:35 +08:00
|
|
|
|
// 安全防护
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
2024-10-05 00:25:04 +08:00
|
|
|
|
scanStartPath: "personal-safety",
|
|
|
|
|
resolvePath: "/personal-safety/",
|
|
|
|
|
},
|
|
|
|
|
// 志愿填报
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
|
|
|
|
scanStartPath: "admission",
|
|
|
|
|
resolvePath: "/admission/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
2024-10-05 00:02:43 +08:00
|
|
|
|
// 海外生活
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
|
|
|
|
scanStartPath: 'overseas',
|
|
|
|
|
resolvePath: '/overseas/',
|
|
|
|
|
},
|
2024-06-24 00:14:35 +08:00
|
|
|
|
// 其它
|
|
|
|
|
{
|
|
|
|
|
...baseConfig,
|
2024-10-05 00:25:04 +08:00
|
|
|
|
scanStartPath: "others",
|
|
|
|
|
resolvePath: "/others/",
|
2024-06-24 00:14:35 +08:00
|
|
|
|
},
|
2024-10-05 00:25:04 +08:00
|
|
|
|
];
|
2024-06-24 00:14:35 +08:00
|
|
|
|
|
|
|
|
|
const themeConfig: ThemeContext = {
|
|
|
|
|
siteTitle: 'RLE.wiki',
|
|
|
|
|
siteDescription: '一份 RLE 指北',
|
2024-09-24 18:25:03 +08:00
|
|
|
|
siteLogo: '/logo-horizontal.svg',
|
|
|
|
|
// SiteTitle值为false时,logo位置不显示标题。未定义SiteTitle时,显示标题。SiteTitle值为abcd时,显示abcd。
|
|
|
|
|
SiteTitle: false,
|
2024-06-24 00:14:35 +08:00
|
|
|
|
/** Repo */
|
|
|
|
|
githubRepoLink: 'https://github.com/project-trans/RLE-wiki',
|
|
|
|
|
/** vitepress 根目录 */
|
|
|
|
|
rootDir: 'docs',
|
|
|
|
|
/** 文档所在目录(目前似未使用此项) */
|
|
|
|
|
include: ['campus', 'contributor-guide', 'fashion'],
|
|
|
|
|
nav,
|
|
|
|
|
sidebarOptions,
|
2024-09-26 22:57:41 +08:00
|
|
|
|
/** 文档所在目录(用于GitHub编辑链接) */
|
2024-09-26 23:19:22 +08:00
|
|
|
|
sitePattern: `docs`,
|
2024-12-05 22:03:55 +08:00
|
|
|
|
hostName: 'https://rle.wiki',
|
2024-06-24 00:14:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// https://vitepress.dev/reference/site-config
|
|
|
|
|
export default withThemeContext(themeConfig, genConfig)
|