Support algoliaOptions object as value in siteConfig.js (#113)

This commit is contained in:
Héctor Ramos 2017-10-04 19:13:30 -07:00 committed by Joel Marcey
parent 56e7c41893
commit 14dfcff769
2 changed files with 8 additions and 3 deletions

View file

@ -29,7 +29,10 @@ const siteConfig = {
...
algolia: {
...
algoliaOptions: '{ facetFilters: [ "tags:VERSION" ], hitsPerPage: 5 }'
algoliaOptions: {
facetFilters: [ "tags:VERSION" ],
hitsPerPage: 5
}
},
}
```

View file

@ -99,9 +99,11 @@ class Site extends React.Component {
apiKey: '${this.props.config.algolia.apiKey}',
indexName: '${this.props.config.algolia.indexName}',
inputSelector: '#search_input_react',
algoliaOptions: '${this.props.config.algolia.algoliaOptions
algoliaOptions: ${
JSON.stringify(this.props.config.algolia.algoliaOptions)
.replace("VERSION", this.props.version || latestVersion)
.replace("LANGUAGE", this.props.language)}'
.replace("LANGUAGE", this.props.language)
}
});
`
}}