config.mts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import { fileURLToPath, URL } from "node:url";
  2. import { defineConfig } from "vitepress";
  3. import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
  4. // https://vitepress.dev/reference/site-config
  5. export default defineConfig({
  6. title: "CocoBlockly帮助文档",
  7. description: "Cococlass help documents",
  8. srcDir: "pages",
  9. vite: {
  10. publicDir: "../public",
  11. plugins: [
  12. /* ... */
  13. VueI18nPlugin({
  14. /* options */
  15. // locale messages resource pre-compile option
  16. // include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'),
  17. }),
  18. ],
  19. resolve: {
  20. alias: [
  21. {
  22. find: /^.*\/VPNavBar\.vue$/,
  23. replacement: fileURLToPath(
  24. new URL("../components/CustomNavBar.vue", import.meta.url)
  25. ),
  26. },
  27. { find: '@/', replacement: fileURLToPath(new URL('../', import.meta.url)) },
  28. ],
  29. },
  30. },
  31. locales: {
  32. root: {
  33. label: "简体中文",
  34. lang: "zh-CN",
  35. themeConfig: {
  36. logo: "/logo.png",
  37. siteTitle: false,
  38. // https://vitepress.dev/reference/default-theme-config
  39. // search: {
  40. // provider: 'local'
  41. // },
  42. // nav: [
  43. // { text: 'Home', link: '/' },
  44. // { text: 'Examples', link: '/markdown-examples' }
  45. // ],
  46. sidebar: [
  47. { text: "关于CocoBlockly X", link: "/docs" },
  48. { text: "常见问题解答", link: "/docs/faq" },
  49. {
  50. text: "开始使用CocoBlockly X",
  51. link: "/docs/start-using-cocoblockly-x",
  52. },
  53. {
  54. text: "电子模块基本教学",
  55. items: [
  56. { text: "todo", link: "/docs" },
  57. ],
  58. },
  59. ],
  60. // socialLinks: [
  61. // { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
  62. // ]
  63. },
  64. },
  65. "zh-HK": {
  66. label: "繁体中文",
  67. lang: "zh-HK",
  68. themeConfig: {
  69. logo: "/logo.png",
  70. siteTitle: false,
  71. // https://vitepress.dev/reference/default-theme-config
  72. // search: {
  73. // provider: 'local'
  74. // },
  75. // nav: [
  76. // { text: 'Home', link: '/' },
  77. // { text: 'Examples', link: '/markdown-examples' }
  78. // ],
  79. sidebar: [
  80. { text: "什麽是CocoBlockly X", link: "/zh-HK/docs" },
  81. { text: "常見問題解答", link: "/zh-HK/docs/faq" },
  82. {
  83. text: "開始使用CocoBlockly X",
  84. link: "/zh-HK/docs/start-using-cocoblockly-x",
  85. },
  86. {
  87. text: "電子模組基本教學",
  88. items: [
  89. { text: "todo", link: "/zh-HK/docs" },
  90. ],
  91. },
  92. ],
  93. // socialLinks: [
  94. // { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
  95. // ]
  96. },
  97. },
  98. },
  99. });