docs: fix gitee search result hostname (#7047)

This commit is contained in:
neverland 2020-08-25 19:01:21 +08:00 committed by GitHub
parent 570b324de3
commit 2368c45753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,18 @@ module.exports = {
apiKey: '90067aecdaa2c85220e2783cd305caac', apiKey: '90067aecdaa2c85220e2783cd305caac',
indexName: 'vant', indexName: 'vant',
placeholder: '搜索文档...', placeholder: '搜索文档...',
transformData(hits) {
if (location.hostname === 'vant-contrib.gitee.io') {
hits.forEach((hit) => {
if (hit.url) {
hit.url = hit.url.replace(
'youzan.github.io',
'vant-contrib.gitee.io'
);
}
});
}
},
}, },
nav: [ nav: [
{ {