From e11d7109ca8bd563fbd9182a0b84dfd20675fb4b Mon Sep 17 00:00:00 2001 From: Rbqwow <55343783+Rbqwow@users.noreply.github.com> Date: Wed, 13 Aug 2025 05:09:48 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=96=87=E6=A1=A3=E7=AB=99=E5=B0=8F?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20(#13659)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 去掉按tab可以选中的在页面左上角的`跳至主要内容` * build: update turbo to 2.5.5 * fix: 干掉语言列表里面的根目录 --- docs/.vuepress/components/LanguageDropdown.ts | 15 +++++++++------ docs/.vuepress/config.ts | 5 ----- docs/.vuepress/styles/palette.scss | 5 +++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/.vuepress/components/LanguageDropdown.ts b/docs/.vuepress/components/LanguageDropdown.ts index add97bf5f7..fa7a25b8cb 100644 --- a/docs/.vuepress/components/LanguageDropdown.ts +++ b/docs/.vuepress/components/LanguageDropdown.ts @@ -1,5 +1,5 @@ import type { VNode } from "vue"; -import { defineComponent, h } from "vue"; +import { defineComponent, h, computed } from "vue"; import NavbarDropdown from "@theme-hope/modules/navbar/components/NavbarDropdown"; import { I18nIcon } from "@theme-hope/modules/navbar/components/icons/index"; @@ -11,17 +11,20 @@ export default defineComponent({ setup() { const dropdown = useNavbarLanguageDropdown(); - const filteredDropdown = () => { + const filteredDropdown = computed(() => { if (!dropdown.value) return null; const filteredConfig = { ...dropdown.value }; if (filteredConfig.children) { - filteredConfig.children = filteredConfig.children.filter(item => item.link !== '/'); + filteredConfig.children = filteredConfig.children.filter(item => { + // 过滤掉跳转到根目录的项目 + return item.link !== '/' && item.link !== '/docs/' && !item.link?.endsWith('/docs/'); + }); } return filteredConfig; - }; + }); //console.log("OldLanguageDropdown", dropdown.value); //console.log("NewLanguageDropdown", filteredDropdown()); @@ -33,11 +36,11 @@ export default defineComponent({ { class: "vp-nav-item" }, h( NavbarDropdown, - { config: filteredDropdown() }, + { config: filteredDropdown.value }, { title: () => h(I18nIcon, { - "aria-label": filteredDropdown()?.ariaLabel, + "aria-label": filteredDropdown.value?.ariaLabel, style: { width: "1rem", height: "1rem", diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index f28e6fb1d0..efcac54209 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -14,11 +14,6 @@ export default defineUserConfig({ port: 3001, locales: { - "/": { - lang: " ", - title: " ", - description: " ", - }, "/zh-cn/": { lang: "zh-cn", description: "文档", diff --git a/docs/.vuepress/styles/palette.scss b/docs/.vuepress/styles/palette.scss index 6d61d6877b..a2f260dda5 100644 --- a/docs/.vuepress/styles/palette.scss +++ b/docs/.vuepress/styles/palette.scss @@ -10,6 +10,11 @@ $vp-font-mono: '"Sarasa Gothic", "Jetbrains mono", "Fira Code", "Noto Sans SC", visibility: hidden !important; } +.vp-skip-link.sr-only { + display: none !important; + visibility: hidden !important; +} + html[lang="ja-JP"] { $vp-font: "Helvetica Neue, Arial, Hiragino Kaku Gothic ProN, Hiragino Sans, Meiryo, sans-serif"; }