[fix] algoliasearch is not defined (#542)
This commit is contained in:
parent
beb5f3d348
commit
6259ac8e98
|
@ -202,6 +202,7 @@ search:
|
||||||
appId:
|
appId:
|
||||||
apiKey:
|
apiKey:
|
||||||
indexName:
|
indexName:
|
||||||
|
js: https://gcore.jsdelivr.net/algoliasearch/3/algoliasearch.min.js
|
||||||
|
|
||||||
|
|
||||||
######## Comments ########
|
######## Comments ########
|
||||||
|
|
|
@ -4,10 +4,9 @@
|
||||||
appId: '<%- conf.appId %>',
|
appId: '<%- conf.appId %>',
|
||||||
apiKey: '<%- conf.apiKey %>',
|
apiKey: '<%- conf.apiKey %>',
|
||||||
indexName: '<%- conf.indexName %>',
|
indexName: '<%- conf.indexName %>',
|
||||||
|
js: '<%- conf.js %>',
|
||||||
hitsPerPage: 100,
|
hitsPerPage: 100,
|
||||||
};
|
};
|
||||||
utils.js('https://gcore.jsdelivr.net/algoliasearch/3/algoliasearch.min.js', { defer: true });
|
|
||||||
utils.js('/js/search/algolia-search.js', { defer: true });
|
utils.js('/js/search/algolia-search.js', { defer: true });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
utils.jq(() => {
|
utils.js(window.searchConfig.js).then(() => {
|
||||||
|
utils.jq(() => {
|
||||||
var $inputArea = $("input#search-input");
|
var $inputArea = $("input#search-input");
|
||||||
if ($inputArea.length === 0) {
|
if ($inputArea.length === 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -72,4 +73,5 @@ utils.jq(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
observer.observe($resultArea[0], { childList: true });
|
observer.observe($resultArea[0], { childList: true });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue