1
Fork 0

Use full path for search index

If the search page is viewed without a trailing slash, it reads the wrong index file and lunr silently fails, resulting in no results being shown
This commit is contained in:
Jake Howard 2021-12-27 12:36:11 +00:00
parent ee78a994e9
commit 16003b57a5
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -79,7 +79,7 @@ $(document).ready(function() {
const initialSearchTerm = getInitialSearchTerm();
searchInput.val(initialSearchTerm);
$.getJSON('./index.json', function(data) {
$.getJSON('/search/index.json', function(data) {
// populate the index
searchIndex = lunr(function() {
this.ref('id');