build: 更新文档主题库 (#11627)

* build: 更新网站依赖

* build:更新vphope版本

* build: 怎么忘记加这个了

* fix: 修复构建错误

* chore: fix Vite CJS Node API deprecated warning

* chore: log

* perf: turbo 添加文档 cache

* perf: 注释掉新版不读取的切换语言公告内容

但公告这个属性得留着 不留着就没有切换语言的弹窗了

* fix: 修复字体问题

* build: update package version

* docs: remove root locale

* docs: add author

* ci: update node version

* build: turbo一直叫我更新,于是我更新了

* docs: update package

* docs: 再见吧牛牛今晚我就要远航

* docs: fix root locale problem

* docs: remove unused command

* feat: 牛兮归来!

* build: update turbo

* chore: 语言提醒怎么又没了 加回来

---------

Co-authored-by: SherkeyXD <57581480+SherkeyXD@users.noreply.github.com>
This commit is contained in:
Rbqwow
2025-04-09 21:09:31 +08:00
committed by GitHub
parent 29dad9ac7f
commit 3bb0833704
15 changed files with 3994 additions and 3008 deletions

View File

@@ -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

View File

@@ -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;
},
});

View File

@@ -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",

View File

@@ -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";
}

View File

@@ -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 });

View File

@@ -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 @@
.
<!-- markdownlint-disable-file -->

View File

@@ -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
---

View File

@@ -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"
}

View File

@@ -15,41 +15,41 @@
"lintfix": "prettier --write --list-different . && yarn lint:js --fix"
},
"dependencies": {
"@iconify/icons-mdi": "^1.2.17",
"@iconify/icons-mdi": "^1.2.48",
"@iconify/react": "^3.2.2",
"@octokit/types": "^6.35.0",
"@react-three/drei": "^9.12.0",
"@react-three/fiber": "^8.0.22",
"@react-three/postprocessing": "^2.3.2",
"@sentry/react": "^7.3.0",
"@sentry/tracing": "^7.3.0",
"clsx": "^1.1.1",
"framer-motion": "^11.1.7",
"moment": "^2.29.4",
"react": "^18.0.1",
"react-dom": "^18.0.1",
"@octokit/types": "^6.41.0",
"@react-three/drei": "^9.121.4",
"@react-three/fiber": "^8.17.14",
"@react-three/postprocessing": "^2.19.1",
"@sentry/react": "^7.120.3",
"@sentry/tracing": "^7.120.3",
"clsx": "^1.2.1",
"framer-motion": "^12.0.11",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-ga-neo": "^2.2.0",
"react-use": "^17.5.0",
"react-use": "^17.6.0",
"swr": "^1.3.0",
"three": "^0.163.0",
"unfetch": "^4.2.0",
"vite": "^4.0.0"
"vite": "^6.0.11"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
"@types/node": "^20.12.7",
"@types/react": "^18.0.1",
"@types/react-dom": "^18.0.1",
"@trivago/prettier-plugin-sort-imports": "^3.4.0",
"@types/node": "^20.17.16",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@types/three": "^0.163.0",
"@vitejs/plugin-react": "^3.0.0",
"autoprefixer": "^10.4.7",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.30.0",
"postcss": "^8.4.14",
"prettier": "^2.7.0",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"eslint": "^9.19.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-react": "^7.37.4",
"postcss": "^8.5.1",
"prettier": "^2.8.8",
"rollup-plugin-analyzer": "^4.0.0",
"tailwindcss": "^3.0.24",
"typescript": "^4.6.3"
"tailwindcss": "^3.4.17",
"typescript": "^4.9.5"
}
}

View File

@@ -1,5 +1,5 @@
{
"include": ["src", "src/types.ts", "vite.config.ts"],
"include": ["src", "src/types.ts", "vite.config.mts"],
"compilerOptions": {
"baseUrl": ".",
"paths": {

View File

@@ -17,7 +17,7 @@ const maaProjectLocationMapping = [
},
];
console.log(`remove ${bundleBasePath}`);
console.log(`[INF] Removing ${bundleBasePath}`);
fs.rmSync(bundleBasePath, { recursive: true, force: true });
maaProjectLocationMapping.forEach(({ from, to }) => {
@@ -25,6 +25,6 @@ maaProjectLocationMapping.forEach(({ from, to }) => {
console.error(`[ERR] ${from} does not exist`);
process.exit(-1);
}
console.log(`[INF] copy ${from} to ${to}`);
console.log(`[INF] Copy ${from} to ${to}`);
fs.cpSync(from, to, { recursive: true });
});

View File

@@ -17,8 +17,8 @@
},
"private": true,
"devDependencies": {
"prettier": "^2.6.2",
"turbo": "^2.3.3"
"prettier": "^2.8.8",
"turbo": "^2.5.0"
},
"packageManager": "pnpm@9.5.0"
"packageManager": "pnpm@10.2.0+sha256.72f1630812107c8723eb5be4517725f3e13f09cfd8f71571cf29f23ce318bdb7"
}

6598
website/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
"outputs": ["dist/**", ".vuepress/dist/**"]
},
"dev": {
"cache": false