From 6b8d706ef3e7342073241f5fdf4a729f90a1b6de Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Wed, 13 Nov 2024 15:31:06 +0000 Subject: [PATCH] Add "Search" section to contributing docs (#1698) --- CONTRIBUTING.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 868c09821d..28f2cb1698 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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` | `[]` | 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 + +
+Exclude a page from search + +```diff + --- + title: Example ++ search: false + --- +``` + +
+ +
+Boost a page in search results + +```diff + --- + title: Example ++ search: ++ rank: 1 + --- +``` + +
+ +
+Show a page in results when searching for "supercalifragilisticexpialidocious" + +```diff + --- + title: Example ++ search: ++ keywords: ++ - supercalifragilisticexpialidocious + --- +``` + +
+ ### 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.