zh.mts 9.0 KB

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