Browse Source

site: Replace hit url

pull/8904/head
Wei Zhu 7 years ago
parent
commit
c06b0e93a0
  1. 7
      site/theme/template/Layout/Header.jsx

7
site/theme/template/Layout/Header.jsx

@ -24,6 +24,13 @@ function initDocSearch(locale) {
indexName: 'ant_design', indexName: 'ant_design',
inputSelector: '#search-box input', inputSelector: '#search-box input',
algoliaOptions: { facetFilters: [`tags:${lang}`] }, 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 debug: false, // Set debug to true if you want to inspect the dropdown
}); });
} }

Loading…
Cancel
Save