docs: enable search

This commit is contained in:
chenjiahan 2021-01-12 20:01:13 +08:00
parent c02483cc4a
commit 05dc67bff4

View File

@ -39,26 +39,25 @@ module.exports = {
url: 'https://github.com/youzan/vant',
},
],
// TODO
// searchConfig: {
// apiKey: '90067aecdaa2c85220e2783cd305caac',
// indexName: 'vant',
// searchParameters: {
// facetFilters: ['lang:zh-CN', 'version:v3'],
// },
// 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;
// },
// },
searchConfig: {
apiKey: '90067aecdaa2c85220e2783cd305caac',
indexName: 'vant',
searchParameters: {
facetFilters: ['lang:zh-CN', 'version:v3'],
},
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: [
{
title: '开发指南',
@ -420,14 +419,13 @@ module.exports = {
url: 'https://github.com/youzan/vant',
},
],
// TODO
// searchConfig: {
// apiKey: '90067aecdaa2c85220e2783cd305caac',
// indexName: 'vant',
// searchParameters: {
// facetFilters: ['lang:en-US', 'version:v3'],
// },
// },
searchConfig: {
apiKey: '90067aecdaa2c85220e2783cd305caac',
indexName: 'vant',
searchParameters: {
facetFilters: ['lang:en-US', 'version:v3'],
},
},
nav: [
{
title: 'Essentials',