From 7d9543ccffccdf6e08d897aa13cb04d08b9fb466 Mon Sep 17 00:00:00 2001 From: liuboaibc Date: Sun, 15 Nov 2020 10:16:07 +0800 Subject: [PATCH] fix search Signed-off-by: liuboaibc --- layouts/partials/searchInput.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/layouts/partials/searchInput.html b/layouts/partials/searchInput.html index 2bcabd983..4fee4facd 100644 --- a/layouts/partials/searchInput.html +++ b/layouts/partials/searchInput.html @@ -19,10 +19,16 @@ docsearch({ hits.forEach(hit => { if (typeof window !== undefined) { var host = window.location.host - if (host == 'kubesphere.com.cn' && language == 'en') { - host = host + '/en' + if (host == 'kubesphere.com.cn') { + if (language == 'en') { + host = host + '/en' + hit.url = hit.url.replace('kubesphere.io', host) + } else if (language == 'zh') { + hit.url = hit.url.replace('kubesphere.io/zh', host) + } + } else { + hit.url = hit.url.replace('kubesphere.io', host) } - hit.url = hit.url.replace('kubesphere.io', host) } }) return hits