Fix for relative paths

This commit is contained in:
Matt Ickstadt 2018-07-23 12:19:59 -05:00
parent 384582aeba
commit d9dbba49ea
1 changed files with 2 additions and 2 deletions

View File

@ -462,12 +462,12 @@ window.search = window.search || {};
showResults(true);
}
fetch('searchindex.json')
fetch(path_to_root + 'searchindex.json')
.then(response => response.json())
.then(json => init(json))
.catch(error => { // Try to load searchindex.js if fetch failed
var script = document.createElement('script');
script.src = 'searchindex.js';
script.src = path_to_root + 'searchindex.js';
script.onload = () => init(window.search);
document.head.appendChild(script);
});