docs(v2): config for self-hosted docsearch crawler (#4524)

This commit is contained in:
ZhengYuan Loo 2021-03-29 23:53:51 +08:00 committed by GitHub
parent b9de28e42f
commit 11843a02fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,9 @@ module.exports = {
// Optional: see doc section below // Optional: see doc section below
contextualSearch: true, contextualSearch: true,
// Optional: see doc section below
appId: 'YOUR_APP_ID',
// Optional: Algolia search parameters // Optional: Algolia search parameters
searchParameters: {}, searchParameters: {},
@ -80,6 +83,24 @@ When using `contextualSearch: true`, the contextual facet filters will be merged
::: :::
### Custom Application ID {#custom-application-id}
When [running your own](https://docsearch.algolia.com/docs/run-your-own/) DocSearch crawler, it is [required to set the `appId` configuration key](https://docsearch.algolia.com/docs/behavior/#appid) to your own Application ID. If left unset, the `appId` will fallback to the one used with the free, hosted version of Algolia DocSearch.
```jsx title="docusaurus.config.js"
module.exports = {
// ...
themeConfig: {
// ...
// highlight-start
algolia: {
appId: 'YOUR_APP_ID',
},
// highlight-end
},
};
```
### Styling your Algolia search {#styling-your-algolia-search} ### Styling your Algolia search {#styling-your-algolia-search}
By default, DocSearch comes with a fine-tuned theme that was designed for accessibility, making sure that colors and contrasts respect standards. By default, DocSearch comes with a fine-tuned theme that was designed for accessibility, making sure that colors and contrasts respect standards.