123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- import { fileURLToPath, URL } from "node:url";
- import { defineConfig } from "vitepress";
- import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
- import Icons from "unplugin-icons/vite";
- import { FileSystemIconLoader } from "unplugin-icons/loaders";
- import {
- SVG,
- cleanupSVG,
- parseColors,
- runSVGO,
- deOptimisePaths,
- importDirectory,
- } from "@iconify/tools";
- import { compareColors, stringToColor } from "@iconify/utils/lib/colors";
- export default defineConfig({
- title: "CocoBlockly帮助文档",
- description: "Cococlass help documents",
- srcDir: "pages",
-
-
-
-
-
- appearance: false,
- vite: {
- publicDir: "../public",
- envDir: '../',
-
-
-
- ssr: {
-
- noExternal: [/vue-i18n/],
- },
- plugins: [
- VueI18nPlugin({
-
-
-
- }),
- Icons({
- compiler: "vue3",
- customCollections: {
- "ccrbi-plain": FileSystemIconLoader(
- "assets/icons/plain",
- async (svgStr) => {
- const svg = new SVG(svgStr);
- cleanupSVG(svg);
- parseColors(svg, {
- defaultColor: "currentColor",
- callback: (attr, colorStr, color) => {
-
-
- return "currentColor";
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- });
-
- runSVGO(svg, {
- keepShapes: true,
- });
- return svg.toMinifiedString({});
- }
- ),
- "ccrbi-colored": FileSystemIconLoader(
- "assets/icons/colored",
- async (svgStr) => {
- const svg = new SVG(svgStr);
- cleanupSVG(svg);
-
- runSVGO(svg, {
- keepShapes: true,
- });
- return svg.toMinifiedString({});
- }
- ),
- },
- }),
- ],
- 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,
-
-
-
-
-
- sidebar: [
- { text: "关于CocoBlockly X", link: "/docs" },
- { text: "常见问题解答", link: "/docs/常见问题解答" },
- {
- text: "开始使用CocoBlockly X",
- link: "/docs/start-using-cocoblockly-x",
- },
- {
- text: "电子模块基本教学",
- collapsed: true,
- items: [{ text: "todo", link: "/docs" }],
- },
- ],
-
-
-
- },
- },
- "zh-HK": {
- label: "繁体中文",
- lang: "zh-HK",
- themeConfig: {
- logo: "/logo.png",
- siteTitle: false,
-
-
-
-
-
- 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: "電子模組基本教學",
- collapsed: true,
- items: [{ text: "todo", link: "/zh-HK/docs" }],
- },
- ],
-
-
-
- },
- },
- },
- });
|