From 835052c4ff94b39d472474543576e6f90cd0cc47 Mon Sep 17 00:00:00 2001 From: zerolee <464806884@qq.com> Date: Wed, 13 Dec 2023 16:32:26 +0800 Subject: [PATCH] update version change condition --- .vitepress/theme/Layout.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vitepress/theme/Layout.vue b/.vitepress/theme/Layout.vue index e0c0fac1..727f6b01 100644 --- a/.vitepress/theme/Layout.vue +++ b/.vitepress/theme/Layout.vue @@ -42,7 +42,12 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => { useEventListener('click', (event) => { const target = event.target as HTMLAnchorElement; - if (target.tagName.toLowerCase() === 'a' && /v[^\/]*\/$/.test(target.href)) { + if ( + target.tagName.toLowerCase() === 'a' && + (/v[^\/]*\/$/.test(target.href) || + (target.href === 'https://docs.deepwisdom.ai/' && + target.target === '_blank')) + ) { event.preventDefault(); const link = `${target.href}${location.pathname .replace(/^\/v[^\/]*\//, '/')