diff --git a/.github/workflows/website-workflow.yml b/.github/workflows/website-workflow.yml index 278debbf91..84b2d5c0ad 100644 --- a/.github/workflows/website-workflow.yml +++ b/.github/workflows/website-workflow.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/docs/.vuepress/components/LanguageDropdown.ts b/docs/.vuepress/components/LanguageDropdown.ts new file mode 100644 index 0000000000..add97bf5f7 --- /dev/null +++ b/docs/.vuepress/components/LanguageDropdown.ts @@ -0,0 +1,52 @@ +import type { VNode } from "vue"; +import { defineComponent, h } from "vue"; + +import NavbarDropdown from "@theme-hope/modules/navbar/components/NavbarDropdown"; +import { I18nIcon } from "@theme-hope/modules/navbar/components/icons/index"; +import { useNavbarLanguageDropdown } from "@theme-hope/modules/navbar/composables/index"; + +export default defineComponent({ + name: "LanguageDropdown", + + setup() { + const dropdown = useNavbarLanguageDropdown(); + + const filteredDropdown = () => { + if (!dropdown.value) return null; + + const filteredConfig = { ...dropdown.value }; + + if (filteredConfig.children) { + filteredConfig.children = filteredConfig.children.filter(item => item.link !== '/'); + } + + return filteredConfig; + }; + + //console.log("OldLanguageDropdown", dropdown.value); + //console.log("NewLanguageDropdown", filteredDropdown()); + + return (): VNode | null => + dropdown.value + ? h( + "div", + { class: "vp-nav-item" }, + h( + NavbarDropdown, + { config: filteredDropdown() }, + { + title: () => + h(I18nIcon, { + "aria-label": filteredDropdown()?.ariaLabel, + style: { + width: "1rem", + height: "1rem", + verticalAlign: "middle", + }, + }), + }, + ), + ) + : null; + }, +}); \ No newline at end of file diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 836ad63e67..f28e6fb1d0 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -1,8 +1,11 @@ import { defineUserConfig } from "vuepress"; +import { getDirname, path } from "vuepress/utils"; import { viteBundler } from "@vuepress/bundler-vite"; import { googleAnalyticsPlugin } from "@vuepress/plugin-google-analytics"; import Theme from "./theme"; +const __dirname = getDirname(import.meta.url); + export default defineUserConfig({ base: "/docs/", lang: "zh-CN", @@ -11,24 +14,29 @@ export default defineUserConfig({ port: 3001, locales: { + "/": { + lang: " ", + title: " ", + description: " ", + }, "/zh-cn/": { - lang: "zh-CN", + lang: "zh-cn", description: "文档", }, "/zh-tw/": { - lang: "zh-TW", + lang: "zh-tw", description: "文件", }, "/en-us/": { - lang: "en-US", + lang: "en-us", description: "Documentation", }, "/ja-jp/": { - lang: "ja-JP", + lang: "ja-jp", description: "ドキュメンテーション", }, "/ko-kr/": { - lang: "ko-KR", + lang: "ko-kr", description: "선적 서류 비치", }, }, @@ -41,6 +49,13 @@ export default defineUserConfig({ theme: Theme, + alias: { + "@theme-hope/modules/navbar/components/LanguageDropdown": path.resolve( + __dirname, + "./components/LanguageDropdown.ts", + ), + }, + plugins: [ googleAnalyticsPlugin({ id: "G-FJQDKG394Z", diff --git a/docs/.vuepress/styles/palette.scss b/docs/.vuepress/styles/palette.scss index 1e9ae7569d..52954b8a10 100644 --- a/docs/.vuepress/styles/palette.scss +++ b/docs/.vuepress/styles/palette.scss @@ -1,10 +1,10 @@ $sidebar-width: 16rem; $content-width: 1000px; -$font-family: '-apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", STHeiti, "Microsoft YaHei", sans-serif'; -$font-family-heading: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "ST Heiti", sans-serif'; -$font-family-mono: '"Sarasa Gothic", "Jetbrains mono", "Fira Code", "Noto Sans SC", Consolas, monospace, Menlo, "Courier New"'; +$vp-font: '-apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", STHeiti, "Microsoft YaHei", sans-serif'; +$vp-font-heading: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "ST Heiti", sans-serif'; +$vp-font-mono: '"Sarasa Gothic", "Jetbrains mono", "Fira Code", "Noto Sans SC", Consolas, monospace, Menlo, "Courier New"'; html[lang="ja-JP"] { - $font-family: "Helvetica Neue, Arial, Hiragino Kaku Gothic ProN, Hiragino Sans, Meiryo, sans-serif"; + $vp-font: "Helvetica Neue, Arial, Hiragino Kaku Gothic ProN, Hiragino Sans, Meiryo, sans-serif"; } diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index 73e188f1ba..e256e1ba6a 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -5,11 +5,15 @@ import { zhcnSidebar, zhtwSidebar, enusSidebar, jajpSidebar, kokrSidebar } from export default hopeTheme({ hostname: "https://maa.plus", - iconAssets: "iconify", + author: "MaaAssistantArknights", + license: "AGPL-3.0", repo: "MaaAssistantArknights/MaaAssistantArknights", docsBranch: "dev", docsDir: "/docs", + lastUpdated: false, + contributors: false, + locales: { "/zh-cn/": { navbar: zhcnNavbar, @@ -23,6 +27,7 @@ export default hopeTheme({ navbar: zhtwNavbar, sidebar: zhtwSidebar, displayFooter: false, + title: '繁体中文', metaLocales: { editLink: "在 Github 上編輯此頁面", }, @@ -53,6 +58,33 @@ export default hopeTheme({ }, }, + markdown: { + align: true, + codeTabs: true, + //echarts: true, + footnote: true, + gfm: true, + hint: true, + imgLazyload: true, + imgMark: true, + imgSize: true, + //mathjax: true, + mark: true, + //mermaid: true, + tabs: true, + tasklist: true, + vPre: true, + component: true, + + highlighter: { + 'type': 'shiki', + themes: { + light: "light-plus", + dark: "nord", + } + }, + }, + plugins: { activeHeaderLinks: false, @@ -66,111 +98,88 @@ export default hopeTheme({ strict: true, }, - copyright: { - license: "AGPL-3.0", - }, - docsearch: DocSearchConfig, - mdEnhance: { - align: true, - codetabs: true, - //echarts: true, - footnote: true, - gfm: true, - hint: true, - imgLazyload: true, - imgMark: true, - imgSize: true, - //mathjax: true, - mark: true, - //mermaid: true, - tabs: true, - tasklist: true, - vPre: true, - component: true, - }, - - shiki: { - themes: { - light: "light-plus", - dark: "nord", - } + icon: { + assets: "iconify", }, sitemap: true, + seo: true, notice: [ - { - path: "/zh-tw/", - title: "翻译警告", - content: "MAA 的文檔以簡體中文為主,其他語言的文檔可能品質低或尚未翻譯,請諒解。", - fullscreen: true, - confirm: true, - showOnce: true, - actions: [ - { - text: "我知道了", - type: "primary", - }, - { text: "前往簡體中文", - link: "/zh-cn/", - }, - ], - }, - { - path: "/en-us/", - title: "Translation Warning", - content: "MAA's documents are mainly in Simplified Chinese. Documents in other languages may be of low quality or not yet translated. Please understand.", - fullscreen: true, - confirm: true, - showOnce: true, - actions: [ - { - text: "Okay", - type: "primary", - }, - { text: "Take me to zh-CN", - link: "/zh-cn/", - }, - ], - }, - { - path: "/ja-jp/", - title: "翻訳に関する警告", - content: "MAA のドキュメントは主に簡体字中国語で書かれており、他の言語のドキュメントは低品質であるか、翻訳されていない可能性がありますので、ご了承ください。", - fullscreen: true, - confirm: true, - showOnce: true, - actions: [ - { - text: "OK", - type: "primary", - }, - { text: "中国語サイトへ行く", - link: "/zh-cn/", - }, - ], - }, - { - path: "/ko-kr/", - title: "번역 경고", - content: "MAA의 문서는 주로 중국어 간체로 되어 있습니다. 다른 언어로 된 문서는 번역이 이상하거나, 번역이 되어있지 않을 수 있습니다.", - fullscreen: true, - confirm: true, - showOnce: true, - actions: [ - { - text: "OK", - type: "primary", - }, - { text: "중국어 간체로 이동", - link: "/zh-cn/", - }, - ], - }, + { + path: "/zh-tw/", + title: "翻译警告", + content: "MAA 的文檔以簡體中文為主,其他語言的文檔可能品質低或尚未翻譯,請諒解。", + fullscreen: true, + confirm: true, + showOnce: true, + actions: [ + { + text: "我知道了", + type: "primary", + }, + { + text: "前往簡體中文", + link: "/zh-cn/", + }, + ], + }, + { + path: "/en-us/", + title: "Translation Warning", + content: "MAA's documents are mainly in Simplified Chinese. Documents in other languages may be of low quality or not yet translated. Please understand.", + fullscreen: true, + confirm: true, + showOnce: true, + actions: [ + { + text: "Okay", + type: "primary", + }, + { + text: "Take me to zh-CN", + link: "/zh-cn/", + }, + ], + }, + { + path: "/ja-jp/", + title: "翻訳に関する警告", + content: "MAA のドキュメントは主に簡体字中国語で書かれており、他の言語のドキュメントは低品質であるか、翻訳されていない可能性がありますので、ご了承ください。", + fullscreen: true, + confirm: true, + showOnce: true, + actions: [ + { + text: "OK", + type: "primary", + }, + { + text: "中国語サイトへ行く", + link: "/zh-cn/", + }, + ], + }, + { + path: "/ko-kr/", + title: "번역 경고", + content: "MAA의 문서는 주로 중국어 간체로 되어 있습니다. 다른 언어로 된 문서는 번역이 이상하거나, 번역이 되어있지 않을 수 있습니다.", + fullscreen: true, + confirm: true, + showOnce: true, + actions: [ + { + text: "OK", + type: "primary", + }, + { + text: "중국어 간체로 이동", + link: "/zh-cn/", + }, + ], + }, ], - }, - -}); +}, { custom: true }); diff --git a/docs/KeepDrinking.md b/docs/KeepDrinking.md index 3ccd60f343..938894a8d6 100644 --- a/docs/KeepDrinking.md +++ b/docs/KeepDrinking.md @@ -1,4 +1,17 @@ - +--- +home: true +pageInfo: false +breadcrumb: false +navbar: false +sidebar: false +index: false +lastUpdated: false +editLink: false +contributors: false +prev: false +next: false +--- + !: .7:~!. :. :?55 ?5~::~J?: @@ -47,7 +60,6 @@ - . . . . . 7^.::?7:^: :7?:...P:. :~~~7P~~~^. :Y ^~~G!~~. :J?:^.?^^5 !! Y^ :Y.. ~~~^~Y!^~~: :P. :^^^JY .7~!.!~::5. .:. ~^ 7? :YJ.77.P:~? Y~~7P~~J: ~7J^~!!P7!!.::JY?J:Y ?^ ^G..5~:P^!J .YJ Y7^Y Y^ :? 5 Y. P @@ -57,6 +69,6 @@ . - + diff --git a/docs/index.md b/docs/index.md index caef8957d7..586e51c8b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,26 +10,21 @@ heroFullScreen: true actions: - text: 简体中文 link: ./zh-cn/ - icon: signs-post type: primary - text: 繁體中文 link: ./zh-tw/ - icon: signs-post type: primary - text: English - icon: lightbulb link: ./en-us/ type: primary - text: 日本語 link: ./ja-jp/ - icon: signs-post type: primary - text: 한국어 link: ./ko-kr/ - icon: signs-post type: primary --- diff --git a/docs/package.json b/docs/package.json index 024dab0158..937feafc7f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,19 +9,18 @@ "license": "AGPL-3.0", "private": true, "devDependencies": { - "@vuepress/bundler-vite": "2.0.0-rc.14", - "@vuepress/plugin-docsearch": "2.0.0-rc.40", - "@vuepress/plugin-google-analytics": "2.0.0-rc.37", - "@vuepress/plugin-shiki": "^2.0.0-rc.40", + "@vuepress/bundler-vite": "^2.0.0-rc.20", + "@vuepress/plugin-docsearch": "^2.0.0-rc.80", + "@vuepress/plugin-google-analytics": "^2.0.0-rc.80", "markdown-it": "^14.1.0", - "markdown-it-anchor": "^9.0.1", - "vue": "^3.4.33", - "vuepress": "2.0.0-rc.14", - "vuepress-theme-hope": "2.0.0-rc.52" + "markdown-it-anchor": "^9.2.0", + "sass-embedded": "^1.86.3", + "vue": "^3.5.13", + "vuepress": "^2.0.0-rc.20", + "vuepress-theme-hope": "^2.0.0-rc.78" }, "scripts": { "dev": "vuepress dev .", - "dev:docs": "vuepress dev .", "build": "vuepress build .", "clean": "vuepress dev . --clean-cache" }