From b2449b589c28a52346d72c4658ff20a29c3b3803 Mon Sep 17 00:00:00 2001 From: developomp Date: Wed, 8 Sep 2021 11:31:19 +0900 Subject: [PATCH] cchanged variable name --- source/generate.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/generate.ts b/source/generate.ts index 2c90700..062b2c8 100644 --- a/source/generate.ts +++ b/source/generate.ts @@ -93,7 +93,7 @@ const map: Map = { unsearchable: {}, } const seriesMap: SeriesMap = {} -const index = elasticlunr(function () { +const elasticlunrIndex = elasticlunr(function () { this.addField("title" as never) this.addField("body" as never) this.setRef("url" as never) @@ -286,7 +286,7 @@ function recursiveParse( } map.posts[urlPath] = postData - index.addDoc({ + elasticlunrIndex.addDoc({ title: markdownData.title, body: markdownData.content, url: urlPath, @@ -312,7 +312,7 @@ function recursiveParse( title: markdownData.title, } - index.addDoc({ + elasticlunrIndex.addDoc({ title: markdownData.title, body: markdownData.content, url: urlPath, @@ -394,7 +394,7 @@ function recursiveParse( map.series[urlPath] = { ...postData, order: [], length: 0 } } else { map.posts[urlPath] = postData - index.addDoc({ + elasticlunrIndex.addDoc({ title: markdownData.title, body: markdownData.content, url: urlPath, @@ -502,4 +502,4 @@ for (const seriesURL in seriesMap) { } fs.writeFileSync(mapFilePath, JSON.stringify(map)) -fs.writeFileSync(outPath + "/search.json", JSON.stringify(index)) +fs.writeFileSync(outPath + "/search.json", JSON.stringify(elasticlunrIndex))