Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
fix: template indexName for search
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenweb committed Aug 20, 2019
1 parent 9bbd1c8 commit 60df994
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/algolia.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import config from "../../config.js";

const pageQuery = `{
pages: allMdx {
edges {
Expand Down Expand Up @@ -27,11 +29,13 @@ const flatten = arr =>
}))
const settings = { attributesToSnippet: [`excerpt:20`] }

const indexName = config.header.search ? config.header.search.indexName : '';

const queries = [
{
query: pageQuery,
transformer: ({ data }) => flatten(data.pages.edges),
indexName: `test`,
indexName: `${indexName}`,
settings,
},
]
Expand Down

0 comments on commit 60df994

Please sign in to comment.