mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-27 15:07:53 +02:00
Support algoliaOptions object as value in siteConfig.js (#113)
This commit is contained in:
parent
56e7c41893
commit
14dfcff769
2 changed files with 8 additions and 3 deletions
|
@ -29,7 +29,10 @@ const siteConfig = {
|
||||||
...
|
...
|
||||||
algolia: {
|
algolia: {
|
||||||
...
|
...
|
||||||
algoliaOptions: '{ facetFilters: [ "tags:VERSION" ], hitsPerPage: 5 }'
|
algoliaOptions: {
|
||||||
|
facetFilters: [ "tags:VERSION" ],
|
||||||
|
hitsPerPage: 5
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -99,9 +99,11 @@ class Site extends React.Component {
|
||||||
apiKey: '${this.props.config.algolia.apiKey}',
|
apiKey: '${this.props.config.algolia.apiKey}',
|
||||||
indexName: '${this.props.config.algolia.indexName}',
|
indexName: '${this.props.config.algolia.indexName}',
|
||||||
inputSelector: '#search_input_react',
|
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("VERSION", this.props.version || latestVersion)
|
||||||
.replace("LANGUAGE", this.props.language)}'
|
.replace("LANGUAGE", this.props.language)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue