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