From 46ad15e8776d24ae1f8d14b0db856376f9774b9a Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Sun, 12 Jun 2022 21:14:10 +0200 Subject: [PATCH] Fix lunr errors --- assets/js/lunr.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/js/lunr.js b/assets/js/lunr.js index 0eb2e67..874ac1b 100644 --- a/assets/js/lunr.js +++ b/assets/js/lunr.js @@ -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); + pagesIndex.forEach(page => { + this.add(page); + }); }); }) ;