site: Replace hit url

This commit is contained in:
Wei Zhu 2018-01-09 19:38:27 +08:00
parent 94944431f1
commit c06b0e93a0

View File

@ -24,6 +24,13 @@ function initDocSearch(locale) {
indexName: 'ant_design',
inputSelector: '#search-box input',
algoliaOptions: { facetFilters: [`tags:${lang}`] },
transformData(hits) {
hits.forEach((hit) => {
hit.url = hit.url.replace('ant.design', location.host);
hit.url = hit.url.replace('https:', location.protocol);
});
return hits;
},
debug: false, // Set debug to true if you want to inspect the dropdown
});
}