From 2368c457536f18daa9ee7d82bff914a471172ee5 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 25 Aug 2020 19:01:21 +0800 Subject: [PATCH] docs: fix gitee search result hostname (#7047) --- vant.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vant.config.js b/vant.config.js index 3b4c22f2b..71a5dd9ef 100644 --- a/vant.config.js +++ b/vant.config.js @@ -38,6 +38,18 @@ module.exports = { apiKey: '90067aecdaa2c85220e2783cd305caac', indexName: 'vant', 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: [ {