From 3eb150bb17973a2e6385f40efc0a69e861d574f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Thu, 29 May 2025 22:17:00 +0800 Subject: [PATCH] fix: lint --- .vitepress/config/en.ts | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.vitepress/config/en.ts b/.vitepress/config/en.ts index 8bd23b2..d02fe6d 100644 --- a/.vitepress/config/en.ts +++ b/.vitepress/config/en.ts @@ -18,12 +18,12 @@ export const config = defineConfig({ sidebar: [ { text: "Quickstart", - base: '/quickstart', + base: locale == 'en' ? '/quickstart' : `/${locale}/quickstart`, items: sidebarQuickstart() }, { text: "Advanced", - base: '/advanced', + base: locale == 'en' ? '/advanced' : `/${locale}/advanced`, items: sidebarAdvanced() }, { @@ -33,7 +33,7 @@ export const config = defineConfig({ ...versions.map((version: string) => { return { text: version, - link: locale != 'en' ? `/${locale}/version-${version}` : `/version-${version}` + link: locale == 'en' ? `/version-${version}` : `/${locale}/version-${version}` } }) ] @@ -74,11 +74,26 @@ export const config = defineConfig({ function nav(): DefaultTheme.NavItem[] { return [ - {text: 'Home', link: '/'}, - {text: 'Document', link: '/quickstart/install'}, - {text: 'Support', link: '/support'}, - {text: '🔥Certificate', link: '/cert'}, - {text: 'About', link: '/about'}, + { + text: 'Home', + link: locale == 'en' ? '/' : `/${locale}/` + }, + { + text: 'Document', + link: locale == 'en' ? '/quickstart/install' : `/${locale}/quickstart/install` + }, + { + text: 'Support', + link: locale == 'en' ? '/support' : `/${locale}/support` + }, + { + text: '🔥Certificate', + link: locale == 'en' ? '/cert' : `/${locale}/cert` + }, + { + text: 'About', + link: locale == 'en' ? '/about' : `/${locale}/about` + }, ] }