diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index a3cb17b05..7a9a3ca43 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -1,8 +1,9 @@ -import { defineUserConfig } from "vuepress"; import { viteBundler } from "@vuepress/bundler-vite"; import { docsearchPlugin } from "@vuepress/plugin-docsearch"; import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics"; +import { defineUserConfig } from "vuepress"; import { redirectPlugin } from "vuepress-plugin-redirect"; + import theme from "./theme.js"; export default defineUserConfig({ @@ -28,6 +29,7 @@ export default defineUserConfig({ }, ], ], + locales: { "/zh/": { lang: "zh-CN", diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index 53dc08ba5..5c95e7a7d 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -60,90 +60,46 @@ export default hopeTheme({ }, }, - plugins: { - // If you don't need comment feature, you can remove following option - // The following config is for demo ONLY, if you need comment feature, please generate and use your own config, see comment plugin documentation for details. - // To avoid disturbing the theme developer and consuming his resources, please DO NOT use the following config directly in your production environment!!!!! comment: { provider: "Waline", serverURL: "https://comments.snapgenshin.com", emoji: [ - '//unpkg.com/@waline/emojis@1.1.0/weibo', - '//unpkg.com/@waline/emojis@1.1.0/bilibili', - '//unpkg.com/@waline/emojis@1.1.0/bmoji', - '//unpkg.com/@waline/emojis@1.1.0/qq', - '//unpkg.com/@waline/emojis@1.1.0/tieba' + "//unpkg.com/@waline/emojis@1.1.0/weibo", + "//unpkg.com/@waline/emojis@1.1.0/bilibili", + "//unpkg.com/@waline/emojis@1.1.0/bmoji", + "//unpkg.com/@waline/emojis@1.1.0/qq", + "//unpkg.com/@waline/emojis@1.1.0/tieba", ], - dark: "auto", - requiredMeta: ['mail'], - login: 'enable', + requiredMeta: ["mail"], reaction: false, }, - // Operational Plugins + components: { + components: ["Badge", "BiliBili"], + }, + feed: { rss: true, }, - seo: true, + sitemap: { - changefreq: "weekly" + changefreq: "weekly", }, - // Disable features you don't want here mdEnhance: { - align: true, - attrs: true, - chart: true, - codetabs: true, - container: true, - demo: true, - echarts: true, - flowchart: true, gfm: true, - imgSize: true, - include: true, - katex: true, imgLazyload: true, - mark: true, - mermaid: true, - playground: { - presets: ["ts", "vue"], - }, - presentation: { - plugins: ["highlight", "math", "search", "notes", "zoom"], - }, - stylize: [ - { - matcher: "Recommanded", - replacer: ({ tag }) => { - if (tag === "em") - return { - tag: "Badge", - attrs: { type: "tip" }, - content: "Recommanded", - }; - }, - }, - ], - sub: true, - sup: true, + include: true, tabs: true, - vPre: true, - vuePlayground: true, - }, - components: { - components: [ - "Badge", - "BiliBili", - ] }, + pwa: { favicon: "/favicon.ico", cacheHTML: false, cachePic: true, appendBase: true, - themeColor: '#f26d6d', + themeColor: "#f26d6d", update: "hint", apple: { icon: "/favicon.ico", @@ -185,7 +141,7 @@ export default hopeTheme({ sizes: "48x48", type: "image/png", }, - ] + ], }, }, }, diff --git a/package.json b/package.json index 0c8c0105b..42d08cc53 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "devDependencies": { "@vuepress/client": "2.0.0-beta.61", + "@vuepress/bundler-vite": "2.0.0-beta.61", "@vuepress/plugin-docsearch": "2.0.0-beta.61", "@vuepress/plugin-google-analytics": "2.0.0-beta.61", "vue": "^3.2.47", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f1d243316..a72cbce51 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,6 +1,7 @@ lockfileVersion: 5.4 specifiers: + '@vuepress/bundler-vite': 2.0.0-beta.61 '@vuepress/client': 2.0.0-beta.61 '@vuepress/plugin-docsearch': 2.0.0-beta.61 '@vuepress/plugin-google-analytics': 2.0.0-beta.61 @@ -10,6 +11,7 @@ specifiers: vuepress-theme-hope: 2.0.0-beta.206 devDependencies: + '@vuepress/bundler-vite': 2.0.0-beta.61 '@vuepress/client': 2.0.0-beta.61 '@vuepress/plugin-docsearch': 2.0.0-beta.61 '@vuepress/plugin-google-analytics': 2.0.0-beta.61