|
|
@@ -0,0 +1,127 @@
|
|
|
+import { createRequire } from 'module'
|
|
|
+import { defineAdditionalConfig, type DefaultTheme } from 'vitepress'
|
|
|
+
|
|
|
+const require = createRequire(import.meta.url)
|
|
|
+const pkg = require('vitepress/package.json')
|
|
|
+
|
|
|
+export default defineAdditionalConfig({
|
|
|
+ lang: 'zh-Hans',
|
|
|
+ description: '一个基于Lua的轻量级跨平台自动构建工具',
|
|
|
+
|
|
|
+ themeConfig: {
|
|
|
+ nav: nav(),
|
|
|
+
|
|
|
+ search: { options: searchOptions() },
|
|
|
+
|
|
|
+ sidebar: {
|
|
|
+ '/zh/guide/': { base: '/zh/guide/', items: sidebarGuide() },
|
|
|
+ },
|
|
|
+
|
|
|
+ editLink: {
|
|
|
+ pattern: 'https://github.com/xmake-io/xmake-docs/edit/master/docs/:path',
|
|
|
+ text: '在 GitHub 上编辑此页面'
|
|
|
+ },
|
|
|
+
|
|
|
+ docFooter: {
|
|
|
+ prev: '上一页',
|
|
|
+ next: '下一页'
|
|
|
+ },
|
|
|
+
|
|
|
+ outline: {
|
|
|
+ label: '页面导航'
|
|
|
+ },
|
|
|
+
|
|
|
+ lastUpdated: {
|
|
|
+ text: '最后更新于'
|
|
|
+ },
|
|
|
+
|
|
|
+ notFound: {
|
|
|
+ title: '页面未找到',
|
|
|
+ quote:
|
|
|
+ '但如果你不改变方向,并且继续寻找,你可能最终会到达你所前往的地方。',
|
|
|
+ linkLabel: '前往首页',
|
|
|
+ linkText: '带我回首页'
|
|
|
+ },
|
|
|
+
|
|
|
+ langMenuLabel: '多语言',
|
|
|
+ returnToTopLabel: '回到顶部',
|
|
|
+ sidebarMenuLabel: '菜单',
|
|
|
+ darkModeSwitchLabel: '主题',
|
|
|
+ lightModeSwitchTitle: '切换到浅色模式',
|
|
|
+ darkModeSwitchTitle: '切换到深色模式',
|
|
|
+ skipToContentLabel: '跳转到内容'
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+function nav(): DefaultTheme.NavItem[] {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ text: '文档',
|
|
|
+ activeMatch: `^/(guide|style-guide|cookbook|examples)/`,
|
|
|
+ items: [
|
|
|
+ { text: '使用指南', link: '/zh/guide/what-is-xmake', activeMatch: '/zh/guide/' },
|
|
|
+ { text: '示例', link: '/zh/examples/' },
|
|
|
+ { text: '快速上手', link: '/zh/guide/getting-started' },
|
|
|
+ { text: 'API 手册', link: '/zh/api/' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { text: '赞助', link: '/zh/about/sponsor' }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+function sidebarGuide(): DefaultTheme.SidebarItem[] {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ text: '简介',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: '什么是 Xmake?', link: 'what-is-xmake' },
|
|
|
+ { text: '快速开始', link: 'getting-started' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+function searchOptions(): Partial<DefaultTheme.AlgoliaSearchOptions> {
|
|
|
+ return {
|
|
|
+ placeholder: '搜索文档',
|
|
|
+ translations: {
|
|
|
+ button: {
|
|
|
+ buttonText: '搜索文档',
|
|
|
+ buttonAriaLabel: '搜索文档'
|
|
|
+ },
|
|
|
+ modal: {
|
|
|
+ searchBox: {
|
|
|
+ resetButtonTitle: '清除查询条件',
|
|
|
+ resetButtonAriaLabel: '清除查询条件',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ cancelButtonAriaLabel: '取消'
|
|
|
+ },
|
|
|
+ startScreen: {
|
|
|
+ recentSearchesTitle: '搜索历史',
|
|
|
+ noRecentSearchesText: '没有搜索历史',
|
|
|
+ saveRecentSearchButtonTitle: '保存至搜索历史',
|
|
|
+ removeRecentSearchButtonTitle: '从搜索历史中移除',
|
|
|
+ favoriteSearchesTitle: '收藏',
|
|
|
+ removeFavoriteSearchButtonTitle: '从收藏中移除'
|
|
|
+ },
|
|
|
+ errorScreen: {
|
|
|
+ titleText: '无法获取结果',
|
|
|
+ helpText: '你可能需要检查你的网络连接'
|
|
|
+ },
|
|
|
+ footer: {
|
|
|
+ selectText: '选择',
|
|
|
+ navigateText: '切换',
|
|
|
+ closeText: '关闭',
|
|
|
+ searchByText: '搜索提供者'
|
|
|
+ },
|
|
|
+ noResultsScreen: {
|
|
|
+ noResultsText: '无法找到相关结果',
|
|
|
+ suggestedQueryText: '你可以尝试查询',
|
|
|
+ reportMissingResultsText: '你认为该查询应该有结果?',
|
|
|
+ reportMissingResultsLinkText: '点击反馈'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|