zh.mts 9.4 KB

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