zh.mts 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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: 'layout-ui/page',
  150. text: 'Page 页面',
  151. },
  152. ],
  153. },
  154. {
  155. collapsed: false,
  156. text: '通用组件',
  157. items: [
  158. {
  159. link: 'common-ui/vben-api-component',
  160. text: 'ApiComponent Api组件包装器',
  161. },
  162. {
  163. link: 'common-ui/vben-modal',
  164. text: 'Modal 模态框',
  165. },
  166. {
  167. link: 'common-ui/vben-drawer',
  168. text: 'Drawer 抽屉',
  169. },
  170. {
  171. link: 'common-ui/vben-form',
  172. text: 'Form 表单',
  173. },
  174. {
  175. link: 'common-ui/vben-vxe-table',
  176. text: 'Vxe Table 表格',
  177. },
  178. {
  179. link: 'common-ui/vben-count-to-animator',
  180. text: 'CountToAnimator 数字动画',
  181. },
  182. ],
  183. },
  184. ];
  185. }
  186. function nav(): DefaultTheme.NavItem[] {
  187. return [
  188. {
  189. activeMatch: '^/(guide|components)/',
  190. text: '文档',
  191. items: [
  192. {
  193. activeMatch: '^/guide/',
  194. link: '/guide/introduction/vben',
  195. text: '指南',
  196. },
  197. {
  198. activeMatch: '^/components/',
  199. link: '/components/introduction',
  200. text: '组件',
  201. },
  202. {
  203. text: '历史版本',
  204. items: [
  205. {
  206. link: 'https://doc.vvbin.cn',
  207. text: '2.x版本文档',
  208. },
  209. ],
  210. },
  211. ],
  212. },
  213. {
  214. text: '演示',
  215. items: [
  216. {
  217. text: 'Vben Admin',
  218. items: [
  219. {
  220. link: 'https://www.vben.pro',
  221. text: '演示版本',
  222. },
  223. {
  224. link: 'https://ant.vben.pro',
  225. text: 'Ant Design Vue 版本',
  226. },
  227. {
  228. link: 'https://naive.vben.pro',
  229. text: 'Naive 版本',
  230. },
  231. {
  232. link: 'https://ele.vben.pro',
  233. text: 'Element Plus版本',
  234. },
  235. ],
  236. },
  237. {
  238. text: '其他',
  239. items: [
  240. {
  241. link: 'https://vben.vvbin.cn',
  242. text: 'Vben Admin 2.x',
  243. },
  244. ],
  245. },
  246. ],
  247. },
  248. {
  249. text: version,
  250. items: [
  251. {
  252. link: 'https://github.com/vbenjs/vue-vben-admin/releases',
  253. text: '更新日志',
  254. },
  255. {
  256. link: 'https://github.com/orgs/vbenjs/projects/5',
  257. text: '路线图',
  258. },
  259. {
  260. link: 'https://github.com/vbenjs/vue-vben-admin/blob/main/.github/contributing.md',
  261. text: '贡献',
  262. },
  263. ],
  264. },
  265. {
  266. link: '/commercial/technical-support',
  267. text: '🦄 技术支持',
  268. },
  269. {
  270. link: '/sponsor/personal',
  271. text: '✨ 赞助',
  272. },
  273. {
  274. link: '/commercial/community',
  275. text: '👨‍👦‍👦 交流群',
  276. // items: [
  277. // {
  278. // 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',
  279. // text: 'QQ频道',
  280. // },
  281. // {
  282. // link: 'https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=mjZmlhgVzzUxvdxllB6C1vHpX8O8QRL0&authKey=DBdFbBwERmfaKY95JvRWqLCJIRGJAmKyZbrpzZ41EKDMZ5SR6MfbjOBaaNRN73fr&noverify=0&group_code=4286109',
  283. // text: 'QQ群',
  284. // },
  285. // {
  286. // link: 'https://discord.gg/VU62jTecad',
  287. // text: 'Discord',
  288. // },
  289. // ],
  290. },
  291. // {
  292. // link: '/friend-links/',
  293. // text: '🤝 友情链接',
  294. // },
  295. ];
  296. }
  297. export const search: DefaultTheme.AlgoliaSearchOptions['locales'] = {
  298. root: {
  299. placeholder: '搜索文档',
  300. translations: {
  301. button: {
  302. buttonAriaLabel: '搜索文档',
  303. buttonText: '搜索文档',
  304. },
  305. modal: {
  306. errorScreen: {
  307. helpText: '你可能需要检查你的网络连接',
  308. titleText: '无法获取结果',
  309. },
  310. footer: {
  311. closeText: '关闭',
  312. navigateText: '切换',
  313. searchByText: '搜索提供者',
  314. selectText: '选择',
  315. },
  316. noResultsScreen: {
  317. noResultsText: '无法找到相关结果',
  318. reportMissingResultsLinkText: '点击反馈',
  319. reportMissingResultsText: '你认为该查询应该有结果?',
  320. suggestedQueryText: '你可以尝试查询',
  321. },
  322. searchBox: {
  323. cancelButtonAriaLabel: '取消',
  324. cancelButtonText: '取消',
  325. resetButtonAriaLabel: '清除查询条件',
  326. resetButtonTitle: '清除查询条件',
  327. },
  328. startScreen: {
  329. favoriteSearchesTitle: '收藏',
  330. noRecentSearchesText: '没有搜索历史',
  331. recentSearchesTitle: '搜索历史',
  332. removeFavoriteSearchButtonTitle: '从收藏中移除',
  333. removeRecentSearchButtonTitle: '从搜索历史中移除',
  334. saveRecentSearchButtonTitle: '保存至搜索历史',
  335. },
  336. },
  337. },
  338. },
  339. };