zh.mts 8.4 KB

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