zh.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. import type { DefaultTheme } from "vitepress";
  2. import { defineConfig } from "vitepress";
  3. export const zh = defineConfig({
  4. lang: "zh-Hans",
  5. description: "React Antd Admin | 企业级管理系统框架",
  6. themeConfig: {
  7. nav: nav(),
  8. sidebar: {
  9. "/zh/guide/": { base: "/zh/guide/", items: sidebarGuide() },
  10. },
  11. editLink: {
  12. pattern: "https://github.com/condorheroblog/react-antd-admin/edit/main/docs/:path",
  13. text: "在 GitHub 上编辑此页面",
  14. },
  15. footer: {
  16. message: "基于 MIT 许可发布",
  17. copyright: `版权所有 © 2023-${new Date().getFullYear()} CondorHero`,
  18. },
  19. docFooter: {
  20. prev: "上一页",
  21. next: "下一页",
  22. },
  23. outline: {
  24. label: "页面导航",
  25. },
  26. lastUpdated: {
  27. text: "最后更新于",
  28. formatOptions: {
  29. dateStyle: "short",
  30. timeStyle: "medium",
  31. },
  32. },
  33. langMenuLabel: "多语言",
  34. returnToTopLabel: "回到顶部",
  35. sidebarMenuLabel: "菜单",
  36. darkModeSwitchLabel: "主题",
  37. lightModeSwitchTitle: "切换到浅色模式",
  38. darkModeSwitchTitle: "切换到深色模式",
  39. },
  40. });
  41. function nav(): DefaultTheme.NavItem[] {
  42. return [
  43. {
  44. text: "在线预览",
  45. link: "https://condorheroblog.github.io/react-antd-admin/",
  46. },
  47. {
  48. text: "指南",
  49. link: "/zh/guide/introduction/",
  50. activeMatch: "/zh/guide/",
  51. },
  52. {
  53. text: "赞助",
  54. link: "/zh/sponsor/",
  55. activeMatch: "/zh/sponsor/",
  56. },
  57. ];
  58. }
  59. function sidebarGuide(): DefaultTheme.SidebarItem[] {
  60. return [
  61. {
  62. text: "简介",
  63. items: [
  64. { text: "介绍", link: "introduction" },
  65. {
  66. link: "introduction/why",
  67. text: "为什么选择我们",
  68. },
  69. { text: "快速开始", link: "introduction/quick-start" },
  70. ],
  71. },
  72. {
  73. text: "基础",
  74. items: [
  75. { text: "目录结构", link: "fundamentals/directory-structure" },
  76. { text: "路由和菜单", link: "fundamentals/routing" },
  77. { text: "图标", link: "fundamentals/icon" },
  78. { text: "样式", link: "fundamentals/style" },
  79. { text: "请求", link: "fundamentals/request" },
  80. { text: "Mock", link: "fundamentals/mock" },
  81. { text: "构建和部署", link: "fundamentals/build" },
  82. { text: "配置", link: "fundamentals/settings" },
  83. ],
  84. },
  85. {
  86. text: "进阶",
  87. items: [
  88. { text: "国际化", link: "advanced/locale" },
  89. { text: "权限", link: "advanced/access" },
  90. { text: "主题", link: "advanced/theme" },
  91. { text: "应用 Loading", link: "advanced/loading" },
  92. { text: "监控网站更新", link: "advanced/monitoring-updates" },
  93. { text: "项目升级", link: "advanced/upgrading" },
  94. ],
  95. },
  96. ];
  97. }
  98. export const search: DefaultTheme.AlgoliaSearchOptions["locales"] = {
  99. zh: {
  100. placeholder: "搜索文档",
  101. translations: {
  102. button: {
  103. buttonText: "搜索文档",
  104. buttonAriaLabel: "搜索文档",
  105. },
  106. modal: {
  107. searchBox: {
  108. resetButtonTitle: "清除查询条件",
  109. resetButtonAriaLabel: "清除查询条件",
  110. cancelButtonText: "取消",
  111. cancelButtonAriaLabel: "取消",
  112. },
  113. startScreen: {
  114. recentSearchesTitle: "搜索历史",
  115. noRecentSearchesText: "没有搜索历史",
  116. saveRecentSearchButtonTitle: "保存至搜索历史",
  117. removeRecentSearchButtonTitle: "从搜索历史中移除",
  118. favoriteSearchesTitle: "收藏",
  119. removeFavoriteSearchButtonTitle: "从收藏中移除",
  120. },
  121. errorScreen: {
  122. titleText: "无法获取结果",
  123. helpText: "你可能需要检查你的网络连接",
  124. },
  125. footer: {
  126. selectText: "选择",
  127. navigateText: "切换",
  128. closeText: "关闭",
  129. searchByText: "搜索提供者",
  130. },
  131. noResultsScreen: {
  132. noResultsText: "无法找到相关结果",
  133. suggestedQueryText: "你可以尝试查询",
  134. reportMissingResultsText: "你认为该查询应该有结果?",
  135. reportMissingResultsLinkText: "点击反馈",
  136. },
  137. },
  138. },
  139. },
  140. };