fix search

Signed-off-by: liuboaibc <kukudehero@gmail.com>
This commit is contained in:
liuboaibc 2020-11-15 10:16:07 +08:00
parent 565c2d646a
commit 7d9543ccff

View File

@ -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