feat(cli): docsearch v3

This commit is contained in:
chenjiahan
2020-12-01 17:25:46 +08:00
parent 63b354e0f1
commit b33737ef77
6 changed files with 211 additions and 105 deletions

View File

@@ -41,17 +41,17 @@ 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'
);
transformItems(items) {
if (location.hostname !== 'youzan.github.io') {
items.forEach((item) => {
if (item.url) {
item.url =
item.url &&
item.url.replace('youzan.github.io', location.hostname);
}
});
}
return items;
},
},
nav: [