mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
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:
2
.github/workflows/website-workflow.yml
vendored
2
.github/workflows/website-workflow.yml
vendored
@@ -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
|
||||
|
||||
52
docs/.vuepress/components/LanguageDropdown.ts
Normal file
52
docs/.vuepress/components/LanguageDropdown.ts
Normal 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;
|
||||
},
|
||||
});
|
||||
@@ -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",
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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
|
||||
---
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user