mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 09:19:16 +02:00
docs(v2): use explicit heading IDs (#4460)
This commit is contained in:
parent
962c3748ea
commit
291a72fbae
162 changed files with 1435 additions and 1435 deletions
|
@ -10,13 +10,13 @@ Docusaurus' own `@docusaurus/preset-classic` supports a search integration.
|
|||
|
||||
There are two main options, you can use [Algolia DocSearch](https://docsearch.algolia.com) or bring in your own `SearchBar` component.
|
||||
|
||||
## Using Algolia DocSearch
|
||||
## Using Algolia DocSearch {#using-algolia-docsearch}
|
||||
|
||||
Algolia DocSearch works by crawling the content of your website every 24 hours and putting all the content in an Algolia index. This content is then queried directly from your front-end using the Algolia API. Note that your website needs to be publicly available for this to work (i.e., not behind a firewall). The service is free.
|
||||
|
||||
If your website is [not eligible](https://docsearch.algolia.com/docs/who-can-apply) for the free, hosted version of DocSearch, or if your website sits behind a firewall, then you can [run your own](https://docsearch.algolia.com/docs/run-your-own/) DocSearch crawler. For best results, you may want to use a config file based on the [Docusaurus 2 config](https://github.com/algolia/docsearch-configs/blob/master/configs/docusaurus-2.json).
|
||||
|
||||
### Connecting Algolia
|
||||
### Connecting Algolia {#connecting-algolia}
|
||||
|
||||
To connect your docs with Algolia, add an `algolia` field in your `themeConfig`. **[Apply for DocSearch](https://docsearch.algolia.com/apply/)** to get your Algolia index and API key.
|
||||
|
||||
|
@ -49,7 +49,7 @@ The `searchParameters` option used to be named `algoliaOptions` in Docusaurus v1
|
|||
|
||||
:::
|
||||
|
||||
### Contextual search
|
||||
### Contextual search {#contextual-search}
|
||||
|
||||
Contextual search is mostly useful for versioned Docusaurus sites.
|
||||
|
||||
|
@ -80,7 +80,7 @@ When using `contextualSearch: true`, the contextual facet filters will be merged
|
|||
|
||||
:::
|
||||
|
||||
### 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.
|
||||
|
||||
|
@ -128,7 +128,7 @@ html[data-theme='dark'] .DocSearch {
|
|||
}
|
||||
```
|
||||
|
||||
### Customizing the Algolia search behavior
|
||||
### Customizing the Algolia search behavior {#customizing-the-algolia-search-behavior}
|
||||
|
||||
<!-- TODO: update options link once the documentation is available on the DocSearch website -->
|
||||
|
||||
|
@ -147,7 +147,7 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
### Editing the Algolia search component
|
||||
### Editing the Algolia search component {#editing-the-algolia-search-component}
|
||||
|
||||
If you prefer to edit the Algolia search React component, swizzle the `SearchBar` component in `@docusaurus/theme-search-algolia`:
|
||||
|
||||
|
@ -155,7 +155,7 @@ If you prefer to edit the Algolia search React component, swizzle the `SearchBar
|
|||
npm run swizzle @docusaurus/theme-search-algolia SearchBar
|
||||
```
|
||||
|
||||
## Using your own search
|
||||
## Using your own search {#using-your-own-search}
|
||||
|
||||
To use your own search, swizzle the `SearchBar` component in `@docusaurus/theme-classic`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue