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', url: 'https://github.com/youzan/vant',
}, },
], ],
// TODO searchConfig: {
// searchConfig: { apiKey: '90067aecdaa2c85220e2783cd305caac',
// apiKey: '90067aecdaa2c85220e2783cd305caac', indexName: 'vant',
// indexName: 'vant', searchParameters: {
// searchParameters: { facetFilters: ['lang:zh-CN', 'version:v3'],
// facetFilters: ['lang:zh-CN', 'version:v3'], },
// }, transformItems(items) {
// transformItems(items) { if (location.hostname !== 'youzan.github.io') {
// if (location.hostname !== 'youzan.github.io') { items.forEach((item) => {
// items.forEach((item) => { if (item.url) {
// if (item.url) { item.url =
// item.url = item.url &&
// item.url && item.url.replace('youzan.github.io', location.hostname);
// item.url.replace('youzan.github.io', location.hostname); }
// } });
// }); }
// } return items;
// return items; },
// }, },
// },
nav: [ nav: [
{ {
title: '开发指南', title: '开发指南',
@ -420,14 +419,13 @@ module.exports = {
url: 'https://github.com/youzan/vant', url: 'https://github.com/youzan/vant',
}, },
], ],
// TODO searchConfig: {
// searchConfig: { apiKey: '90067aecdaa2c85220e2783cd305caac',
// apiKey: '90067aecdaa2c85220e2783cd305caac', indexName: 'vant',
// indexName: 'vant', searchParameters: {
// searchParameters: { facetFilters: ['lang:en-US', 'version:v3'],
// facetFilters: ['lang:en-US', 'version:v3'], },
// }, },
// },
nav: [ nav: [
{ {
title: 'Essentials', title: 'Essentials',