zh.mts 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. import { type DefaultTheme, defineConfig } from 'vitepress';
  2. import { version } from '../../../package.json';
  3. export const zh = defineConfig({
  4. description: 'Vben Admin & 企业级管理系统框架',
  5. lang: 'zh-Hans',
  6. themeConfig: {
  7. darkModeSwitchLabel: '主题',
  8. darkModeSwitchTitle: '切换到深色模式',
  9. docFooter: {
  10. next: '下一页',
  11. prev: '上一页',
  12. },
  13. editLink: {
  14. pattern: 'https://github.com/vbenjs/vue-vben-admin/edit/main/docs/:path',
  15. text: '在 GitHub 上编辑此页面',
  16. },
  17. footer: {
  18. copyright: `Copyright © 2020-${new Date().getFullYear()} Vben`,
  19. message: '基于 MIT 许可发布.',
  20. },
  21. langMenuLabel: '多语言',
  22. lastUpdated: {
  23. formatOptions: {
  24. dateStyle: 'short',
  25. timeStyle: 'medium',
  26. },
  27. text: '最后更新于',
  28. },
  29. lightModeSwitchTitle: '切换到浅色模式',
  30. nav: nav(),
  31. outline: {
  32. label: '页面导航',
  33. },
  34. returnToTopLabel: '回到顶部',
  35. sidebar: {
  36. '/commercial/': { base: '/commercial/', items: sidebarCommercial() },
  37. '/guide/': { base: '/guide/', items: sidebarGuide() },
  38. },
  39. sidebarMenuLabel: '菜单',
  40. },
  41. });
  42. function sidebarGuide(): DefaultTheme.SidebarItem[] {
  43. return [
  44. {
  45. collapsed: false,
  46. text: '简介',
  47. items: [
  48. {
  49. link: 'introduction/vben',
  50. text: '关于 Vben Admin',
  51. },
  52. {
  53. link: 'introduction/why',
  54. text: '为什么选择我们?',
  55. },
  56. { link: 'introduction/quick-start', text: '快速开始' },
  57. { link: 'introduction/thin', text: '精简版本' },
  58. ],
  59. },
  60. {
  61. text: '基础',
  62. items: [
  63. { link: 'essentials/concept', text: '基础概念' },
  64. { link: 'essentials/development', text: '本地开发' },
  65. { link: 'essentials/route', text: '路由和菜单' },
  66. { link: 'essentials/settings', text: '配置' },
  67. { link: 'essentials/icons', text: '图标' },
  68. { link: 'essentials/styles', text: '样式' },
  69. { link: 'essentials/external-module', text: '外部模块' },
  70. { link: 'essentials/build', text: '构建与部署' },
  71. { link: 'essentials/server', text: '服务端交互与数据Mock' },
  72. ],
  73. },
  74. {
  75. text: '深入',
  76. items: [
  77. { link: 'in-depth/login', text: '登录' },
  78. // { link: 'in-depth/layout', text: '布局' },
  79. { link: 'in-depth/theme', text: '主题' },
  80. { link: 'in-depth/access', text: '权限' },
  81. { link: 'in-depth/locale', text: '国际化' },
  82. { link: 'in-depth/features', text: '常用功能' },
  83. { link: 'in-depth/check-updates', text: '检查更新' },
  84. { link: 'in-depth/loading', text: '全局loading' },
  85. { link: 'in-depth/ui-framework', text: '组件库切换' },
  86. ],
  87. },
  88. {
  89. text: '工程',
  90. items: [
  91. { link: 'project/standard', text: '规范' },
  92. { link: 'project/cli', text: 'CLI' },
  93. { link: 'project/dir', text: '目录说明' },
  94. { link: 'project/test', text: '单元测试' },
  95. { link: 'project/tailwindcss', text: 'Tailwind CSS' },
  96. { link: 'project/changeset', text: 'Changeset' },
  97. { link: 'project/vite', text: 'Vite Config' },
  98. ],
  99. },
  100. {
  101. text: '其他',
  102. items: [
  103. { link: 'other/project-update', text: '项目更新' },
  104. { link: 'other/remove-code', text: '移除代码' },
  105. { link: 'other/faq', text: '常见问题' },
  106. ],
  107. },
  108. ];
  109. }
  110. function sidebarCommercial(): DefaultTheme.SidebarItem[] {
  111. return [
  112. {
  113. link: 'community',
  114. text: '社区交流',
  115. },
  116. {
  117. link: 'technical-support',
  118. text: '技术支持',
  119. },
  120. {
  121. link: 'customized',
  122. text: '定制开发',
  123. },
  124. ];
  125. }
  126. function nav(): DefaultTheme.NavItem[] {
  127. return [
  128. {
  129. text: '文档',
  130. items: [
  131. {
  132. link: '/guide/introduction/vben',
  133. text: '指南',
  134. // items: [
  135. // {
  136. // link: '/guide/introduction/vben',
  137. // text: '简介',
  138. // },
  139. // {
  140. // link: '/guide/essentials/concept',
  141. // text: '基础',
  142. // },
  143. // {
  144. // link: '/guide/in-depth/layout',
  145. // text: '深入',
  146. // },
  147. // {
  148. // link: '/guide/project/standard',
  149. // text: '工程',
  150. // },
  151. // {
  152. // link: '/guide/other/project-update',
  153. // text: '其他',
  154. // },
  155. // ],
  156. },
  157. {
  158. text: '历史版本',
  159. items: [
  160. {
  161. link: 'https://doc.vvbin.cn',
  162. text: '2.x版本文档',
  163. },
  164. ],
  165. },
  166. ],
  167. },
  168. {
  169. text: '演示',
  170. items: [
  171. {
  172. text: 'Vben Admin',
  173. items: [
  174. {
  175. link: 'https://www.vben.pro',
  176. text: '演示版本',
  177. },
  178. {
  179. link: 'https://ant.vben.pro',
  180. text: 'Ant Design Vue 版本',
  181. },
  182. {
  183. link: 'https://naive.vben.pro',
  184. text: 'Naive 版本',
  185. },
  186. {
  187. link: 'https://ele.vben.pro',
  188. text: 'Element Plus版本',
  189. },
  190. ],
  191. },
  192. {
  193. text: '其他',
  194. items: [
  195. {
  196. link: 'https://vben.vvbin.cn',
  197. text: 'Vben Admin 2.x',
  198. },
  199. ],
  200. },
  201. ],
  202. },
  203. {
  204. text: version,
  205. items: [
  206. {
  207. link: 'https://github.com/vbenjs/vue-vben-admin/releases',
  208. text: '更新日志',
  209. },
  210. {
  211. link: 'https://github.com/orgs/vbenjs/projects/5',
  212. text: '路线图',
  213. },
  214. {
  215. link: 'https://github.com/vbenjs/vue-vben-admin/blob/main/.github/contributing.md',
  216. text: '贡献',
  217. },
  218. ],
  219. },
  220. {
  221. link: '/commercial/technical-support',
  222. text: '🦄 技术支持',
  223. },
  224. {
  225. link: '/sponsor/personal',
  226. text: '✨ 赞助',
  227. },
  228. {
  229. link: '/commercial/community',
  230. text: '👨‍👦‍👦 社区交流',
  231. // items: [
  232. // {
  233. // link: 'https://qun.qq.com/qqweb/qunpro/share?_wv=3&_wwv=128&appChannel=share&inviteCode=22ySzj7pKiw&businessType=9&from=246610&biz=ka&mainSourceId=share&subSourceId=others&jumpsource=shorturl#/pc',
  234. // text: 'QQ频道',
  235. // },
  236. // {
  237. // link: 'https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=mjZmlhgVzzUxvdxllB6C1vHpX8O8QRL0&authKey=DBdFbBwERmfaKY95JvRWqLCJIRGJAmKyZbrpzZ41EKDMZ5SR6MfbjOBaaNRN73fr&noverify=0&group_code=4286109',
  238. // text: 'QQ群',
  239. // },
  240. // {
  241. // link: 'https://discord.gg/VU62jTecad',
  242. // text: 'Discord',
  243. // },
  244. // ],
  245. },
  246. {
  247. link: '/friend-links/',
  248. text: '🤝 友情链接',
  249. },
  250. ];
  251. }
  252. export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
  253. root: {
  254. placeholder: '搜索文档',
  255. translations: {
  256. button: {
  257. buttonAriaLabel: '搜索文档',
  258. buttonText: '搜索文档',
  259. },
  260. modal: {
  261. errorScreen: {
  262. helpText: '你可能需要检查你的网络连接',
  263. titleText: '无法获取结果',
  264. },
  265. footer: {
  266. closeText: '关闭',
  267. navigateText: '切换',
  268. searchByText: '搜索提供者',
  269. selectText: '选择',
  270. },
  271. noResultsScreen: {
  272. noResultsText: '无法找到相关结果',
  273. reportMissingResultsLinkText: '点击反馈',
  274. reportMissingResultsText: '你认为该查询应该有结果?',
  275. suggestedQueryText: '你可以尝试查询',
  276. },
  277. searchBox: {
  278. cancelButtonAriaLabel: '取消',
  279. cancelButtonText: '取消',
  280. resetButtonAriaLabel: '清除查询条件',
  281. resetButtonTitle: '清除查询条件',
  282. },
  283. startScreen: {
  284. favoriteSearchesTitle: '收藏',
  285. noRecentSearchesText: '没有搜索历史',
  286. recentSearchesTitle: '搜索历史',
  287. removeFavoriteSearchButtonTitle: '从收藏中移除',
  288. removeRecentSearchButtonTitle: '从搜索历史中移除',
  289. saveRecentSearchButtonTitle: '保存至搜索历史',
  290. },
  291. },
  292. },
  293. },
  294. };