Merge pull request #530 from liuboaibc/fix-search

fix search
This commit is contained in:
KubeSphere CI Bot 2020-11-16 17:48:33 +08:00 committed by GitHub
commit 1f91a7052b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,10 +20,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