Fix lunr errors
This commit is contained in:
parent
e4d0da4e56
commit
46ad15e877
@ -1,6 +1,7 @@
|
|||||||
const lunr = require('lunr');
|
const lunr = require('lunr');
|
||||||
|
|
||||||
fetch("/js/lunr/PagesIndex.json")
|
fetch("/js/lunr/PagesIndex.json")
|
||||||
|
.then(res => res.json())
|
||||||
.then(pagesIndex => {
|
.then(pagesIndex => {
|
||||||
const lunrIndex = lunr(function() {
|
const lunrIndex = lunr(function() {
|
||||||
this.field('title', {
|
this.field('title', {
|
||||||
@ -12,10 +13,10 @@ fetch("/js/lunr/PagesIndex.json")
|
|||||||
this.field('content');
|
this.field('content');
|
||||||
|
|
||||||
this.ref('href');
|
this.ref('href');
|
||||||
});
|
|
||||||
|
|
||||||
pagesIndex.forEach(page => {
|
pagesIndex.forEach(page => {
|
||||||
lunrIndex.add(page);
|
this.add(page);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user