Skip to content

Commit 60df994

Browse files
committed
fix: template indexName for search
1 parent 9bbd1c8 commit 60df994

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/utils/algolia.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import config from "../../config.js";
2+
13
const pageQuery = `{
24
pages: allMdx {
35
edges {
@@ -27,11 +29,13 @@ const flatten = arr =>
2729
}))
2830
const settings = { attributesToSnippet: [`excerpt:20`] }
2931

32+
const indexName = config.header.search ? config.header.search.indexName : '';
33+
3034
const queries = [
3135
{
3236
query: pageQuery,
3337
transformer: ({ data }) => flatten(data.pages.edges),
34-
indexName: `test`,
38+
indexName: `${indexName}`,
3539
settings,
3640
},
3741
]

0 commit comments

Comments
 (0)