From f3a198391e68faa2e2e23fb42ea6500f3b206606 Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Tue, 10 Jun 2025 10:28:30 +0800 Subject: [PATCH] update useDocLink --- web/context/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/context/i18n.ts b/web/context/i18n.ts index 3645e25add..8a78c933fa 100644 --- a/web/context/i18n.ts +++ b/web/context/i18n.ts @@ -40,8 +40,8 @@ export const useDocLink = (baseUrl?: string): ((path?: string, pathMap?: { [inde let baseDocUrl = baseUrl || defaultDocBaseUrl baseDocUrl = (baseDocUrl.endsWith('/')) ? baseDocUrl.slice(0, -1) : baseDocUrl const { locale } = useI18N() + const docLanguage = getDocLanguage(locale) return (path?: string, pathMap?: { [index: string]: string }): string => { - const docLanguage = getDocLanguage(locale) const pathUrl = path || '' let targetPath = (pathMap) ? pathMap[locale] || pathUrl : pathUrl targetPath = (targetPath.startsWith('/')) ? targetPath.slice(0, -1) : targetPath