utils.js(window.searchConfig.js).then(() => { utils.jq(() => { var $inputArea = $("input#search-input"); if ($inputArea.length === 0) { return; } var $resultArea = $("#search-result"); var $searchWrapper = $("#search-wrapper"); var client = algoliasearch(window.searchConfig.appId, window.searchConfig.apiKey); var index = client.initIndex(window.searchConfig.indexName); function filterResults(hits, filterPath) { if (!filterPath || filterPath === '/') return hits; var regex = new RegExp(filterPath); return hits.filter(hit => regex.test(hit.url)); } function displayResults(hits) { var $resultList = $("