Skip to content

Commit

Permalink
Add "Search" section to contributing docs (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc authored Nov 13, 2024
1 parent 8d2f713 commit 6b8d706
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,59 @@ description: Some brief, but effective description of the page's content.
These fields should be present on every documentation page.
#### Search
The `search` frontmatter field can be used to control how a page is indexed by [Algolia Crawler](https://www.algolia.com/doc/tools/crawler/getting-started/overview/). It has the following subfields:
| Name | Type | Default | Description |
| ---------- | --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exclude` | `boolean` | `false` | Whether to exclude the page from search entirely |
| `rank` | `number` | `0` | The value to use for `weight.pageRank` in the index. See [Custom Ranking](https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/) and [Boost search results with `pageRank`](https://docsearch.algolia.com/docs/record-extractor/#boost-search-results-with-pagerank) |
| `keywords` | `Array<string>` | `[]` | Additional [searchable](https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/) keywords to include when indexing the page. These are not visible to users. |
You may also set `search` to a boolean value, which acts as an `exclude` value. See the first example below.
##### Examples
<details>
<summary>Exclude a page from search</summary>
```diff
---
title: Example
+ search: false
---
```
</details>
<details>
<summary>Boost a page in search results</summary>
```diff
---
title: Example
+ search:
+ rank: 1
---
```
</details>
<details>
<summary>Show a page in results when searching for "supercalifragilisticexpialidocious"</summary>
```diff
---
title: Example
+ search:
+ keywords:
+ - supercalifragilisticexpialidocious
---
```
</details>
### Headings
Headings should be nested by their rank. Headings with an equal or higher rank start a new section, headings with a lower rank start new subsections that are part of the higher ranked section. Please see the [Web Accessibility Initiative documentation](https://www.w3.org/WAI/tutorials/page-structure/headings/) for more information.
Expand Down

0 comments on commit 6b8d706

Please sign in to comment.