better docsearch management, fix typos
This commit is contained in:
parent
c3fd6c04be
commit
088bf96729
1 changed files with 14 additions and 17 deletions
|
|
@ -73,18 +73,19 @@ documentation.
|
|||
along the HTML flow. The level `X` (for `lvlX`) should appear after a level
|
||||
`Y` while `X>Y`.
|
||||
|
||||
- `lvlX` selectors should use the standard title tags like `h1`, `h2`, `h3`, ...
|
||||
You can add a class to these elements. Do not forget to set a unique `id` or
|
||||
`name` attribute to these elements as explain below.
|
||||
- `lvlX` selectors should use the standard title tags like `h1`, `h2`, `h3`,
|
||||
etc. You can also use static class. Set a unique `id` or `name` attribute to
|
||||
these elements as detailed below.
|
||||
|
||||
- Every `lvlx` DOM elements (matching the selectors defined in your
|
||||
configuration) must have a unique `id` or `name`. This will help the
|
||||
redirection to directly scroll down to the exact place of the matching
|
||||
elements. These attributes defined the right anchor to use.
|
||||
- Every DOM elements matching the `lvlX` selectors must have a unique `id` or
|
||||
`name` attribute. This will help the redirection to directly scroll down to
|
||||
the exact place of the matching elements. These attributes defined the right
|
||||
anchor to use.
|
||||
|
||||
- Every textual element (selector `text`) must be wrapped in a tag `<p/>` or
|
||||
`<li/>`. This content must be atomic and split into small entities. Be careful
|
||||
to never nest one of these tags into another one, it will create duplicates.
|
||||
to never nest one matching elements into another one, it will create
|
||||
duplicates.
|
||||
|
||||
- Stay consistent and do not forget that we need to have some regularity along
|
||||
the HTML flow [as presented here][1].
|
||||
|
|
@ -92,7 +93,7 @@ documentation.
|
|||
## Introduces global information as meta tags
|
||||
|
||||
Our crawler automatically extract information from our DocSearch specific meta
|
||||
tag:
|
||||
tags:
|
||||
|
||||
```html
|
||||
<meta name="docsearch:language" content="en" />
|
||||
|
|
@ -100,19 +101,15 @@ tag:
|
|||
```
|
||||
|
||||
The `content` value of the meta will be added to every records extracted from
|
||||
the page. Given that the name is `DocSearch:$NAME`, `$NAME` will be set as a
|
||||
the page. Given that the name is `DocSearch:$NAME`, `$NAME` will be set as an
|
||||
attribute in each of them. Its value will be its related `content` value. You
|
||||
can then transform them as [`facetFilters`][4] to filter over them. We will need
|
||||
to use Algolia settings via the DocSearch `custom_settings` parameter and set
|
||||
`attributesForFaceting` Algolia parameter.
|
||||
|
||||
Look at this example with our vuepress integration:
|
||||
to set the settings of your Algolia indec via the DocSearch `custom_settings`
|
||||
parameter and set `attributesForFaceting` Algolia parameter accordingly.
|
||||
|
||||
```json
|
||||
"custom_settings": {
|
||||
"attributesForFaceting": [
|
||||
"lang"
|
||||
]
|
||||
"attributesForFaceting": ["language", "version"]
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue