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