Fix lunr errors

This commit is contained in:
Daniel_I_Am 2022-06-12 21:14:10 +02:00
parent e4d0da4e56
commit 46ad15e877

View File

@ -1,6 +1,7 @@
const lunr = require('lunr');
fetch("/js/lunr/PagesIndex.json")
.then(res => res.json())
.then(pagesIndex => {
const lunrIndex = lunr(function() {
this.field('title', {
@ -12,10 +13,10 @@ fetch("/js/lunr/PagesIndex.json")
this.field('content');
this.ref('href');
});
pagesIndex.forEach(page => {
lunrIndex.add(page);
this.add(page);
});
});
})
;