import { fileURLToPath, URL } from "node:url"; import { defineConfig } from "vitepress"; import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' // https://vitepress.dev/reference/site-config export default defineConfig({ title: "CocoBlockly帮助文档", description: "Cococlass help documents", srcDir: "pages", vite: { publicDir: "../public", plugins: [ /* ... */ VueI18nPlugin({ /* options */ // locale messages resource pre-compile option // include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'), }), ], resolve: { alias: [ { find: /^.*\/VPNavBar\.vue$/, replacement: fileURLToPath( new URL("../components/CustomNavBar.vue", import.meta.url) ), }, { find: '@/', replacement: fileURLToPath(new URL('../', import.meta.url)) }, ], }, }, locales: { root: { label: "简体中文", lang: "zh-CN", themeConfig: { logo: "/logo.png", siteTitle: false, // https://vitepress.dev/reference/default-theme-config // search: { // provider: 'local' // }, // nav: [ // { text: 'Home', link: '/' }, // { text: 'Examples', link: '/markdown-examples' } // ], sidebar: [ { text: "关于CocoBlockly X", link: "/docs" }, { text: "常见问题解答", link: "/docs/faq" }, { text: "开始使用CocoBlockly X", link: "/docs/start-using-cocoblockly-x", }, { text: "电子模块基本教学", items: [ { text: "todo", link: "/docs" }, ], }, ], // socialLinks: [ // { icon: 'github', link: 'https://github.com/vuejs/vitepress' } // ] }, }, "zh-HK": { label: "繁体中文", lang: "zh-HK", themeConfig: { logo: "/logo.png", siteTitle: false, // https://vitepress.dev/reference/default-theme-config // search: { // provider: 'local' // }, // nav: [ // { text: 'Home', link: '/' }, // { text: 'Examples', link: '/markdown-examples' } // ], sidebar: [ { text: "什麽是CocoBlockly X", link: "/zh-HK/docs" }, { text: "常見問題解答", link: "/zh-HK/docs/faq" }, { text: "開始使用CocoBlockly X", link: "/zh-HK/docs/start-using-cocoblockly-x", }, { text: "電子模組基本教學", items: [ { text: "todo", link: "/zh-HK/docs" }, ], }, ], // socialLinks: [ // { icon: 'github', link: 'https://github.com/vuejs/vitepress' } // ] }, }, }, });