zh.mts 9.4 KB

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