Skip to content

Commit 0fb3a4e

Browse files
committed
Updated documentation
1 parent c78519c commit 0fb3a4e

File tree

2 files changed

+56
-30
lines changed

2 files changed

+56
-30
lines changed

docs/insiders/index.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ The following features are currently exclusively available to sponsors:
111111

112112
<div class="mdx-columns" markdown="1">
113113

114+
- [x] [Boosting pages in search :material-new-box:][30]
114115
- [x] [Tags (with search integration) :material-new-box:][29]
115-
- [x] [Stay on page when switching versions :material-new-box:][28]
116-
- [x] [Version warning :material-new-box:][26]
116+
- [x] [Stay on page when switching versions][28]
117+
- [x] [Version warning][26]
117118
- [x] [Custom admonition icons][28]
118119
- [x] [Code block annotations][25]
119120
- [x] [Anchor tracking ][24]
@@ -183,9 +184,11 @@ the public for general availability.
183184

184185
#### $ 6,000 – Trinidad Scorpion
185186

187+
- [x] [Boosting pages in search][30]
186188
- [ ] Improved search result summaries
187189
- [ ] Stay on page when switching languages
188-
- [ ] List of last searches
190+
191+
[30]: ../setup/setting-up-site-search.md#boosting-a-page
189192

190193
#### $ 7,000 – Royal Gold
191194

@@ -195,19 +198,19 @@ the public for general availability.
195198

196199
#### $ 8,000 – Scotch Bonnet
197200

198-
- [x] [Custom admonition icons][30]
201+
- [x] [Custom admonition icons][31]
199202
- [ ] Table of contents shows which sections have search results
200-
- [ ] TBA
203+
- [ ] List of last searches
201204

202-
[30]: ../reference/admonitions.md#changing-the-icons
205+
[31]: ../reference/admonitions.md#changing-the-icons
203206

204207
#### Future
205208

206-
- [ ] [Material for MkDocs Live Edit][31]
209+
- [ ] [Material for MkDocs Live Edit][32]
207210
- [ ] New layouts and styles
208211
- [ ] Code block palette toggle
209212

210-
[31]: https://twitter.com/squidfunk/status/1338252230265360391
213+
[32]: https://twitter.com/squidfunk/status/1338252230265360391
211214

212215
### Goals completed
213216

@@ -262,10 +265,10 @@ implemented behind feature flags; all configuration changes are
262265
backward-compatible. This means that your users will be able to build the
263266
documentation locally with Material for MkDocs and when they push their changes,
264267
it can be built with Insiders (e.g. as part of GitHub Actions). Thus, it's
265-
recommended to [install Insiders][32] only in CI, as you don't want to expose
268+
recommended to [install Insiders][33] only in CI, as you don't want to expose
266269
your `GH_TOKEN` to users.
267270

268-
[32]: ../publishing-your-site.md#github-pages
271+
[33]: ../publishing-your-site.md#github-pages
269272

270273
### Terms
271274

@@ -274,7 +277,7 @@ commercial project. Can we use Insiders under the same terms and conditions?_
274277

275278
Yes. Whether you're an individual or a company, you may use _Material for MkDocs
276279
Insiders_ precisely under the same terms as Material for MkDocs, which are given
277-
by the [MIT license][33]. However, we kindly ask you to respect the following
280+
by the [MIT license][34]. However, we kindly ask you to respect the following
278281
guidelines:
279282

280283
- Please __don't distribute the source code__ of Insiders. You may freely use
@@ -285,7 +288,7 @@ guidelines:
285288
- If you cancel your subscription, you're removed as a collaborator and will
286289
miss out on future updates of Insiders. However, you may __use the latest
287290
version__ that's available to you __as long as you like__. Just remember that
288-
[GitHub deletes private forks][34].
291+
[GitHub deletes private forks][35].
289292

290-
[33]: ../license.md
291-
[34]: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/removing-a-collaborator-from-a-personal-repository
293+
[34]: ../license.md
294+
[35]: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/removing-a-collaborator-from-a-personal-repository

docs/setup/setting-up-site-search.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,29 @@ For setup instructions, refer to the [official documentation][18].
261261
system, you will also want to set `use_directory_urls: false` in
262262
`mkdocs.yml` to make page links function correctly.
263263

264+
## Usage
265+
266+
### Boosting a page
267+
268+
[:octicons-file-code-24: Source][8] ·
269+
:octicons-note-24: Metadata ·
270+
[:octicons-heart-fill-24:{ .mdx-heart } Insiders only][8]{ .mdx-insiders }
271+
272+
In order to give specific pages a higher relevance in search, [lunr][4] supports
273+
page-specific boosts, which can be defined for each page by leveraging the
274+
[Metadata][19] extension:
275+
276+
``` yaml
277+
---
278+
search:
279+
boost: 100
280+
---
281+
282+
...
283+
```
284+
285+
[19]: ../../reference/meta-tags/#metadata
286+
264287
## Customization
265288

266289
The search implementation of Material for MkDocs is probably its most
@@ -273,12 +296,12 @@ your needs.
273296

274297
### Query transformation
275298

276-
[:octicons-file-code-24: Source][19] ·
299+
[:octicons-file-code-24: Source][20] ·
277300
:octicons-mortar-board-24: Difficulty: _easy_
278301

279302
When a user enters a query into the search box, the query is pre-processed
280303
before it is submitted to the search index. Material for MkDocs will apply the
281-
following transformations, which can be customized by [extending the theme][20]:
304+
following transformations, which can be customized by [extending the theme][21]:
282305

283306
``` ts
284307
/**
@@ -318,7 +341,7 @@ export function defaultTransform(query: string): string {
318341
If you want to switch to the default behavior of the `mkdocs` and `readthedocs`
319342
themes, both of which don't transform the query prior to submission, or
320343
customize the `transform` function, you can do this by [overriding the
321-
`config` block][21]:
344+
`config` block][22]:
322345

323346
``` html
324347
{% block config %}
@@ -336,19 +359,19 @@ customize the `transform` function, you can do this by [overriding the
336359
The `transform` function will receive the query string as entered by the user
337360
and must return the processed query string to be submitted to the search index.
338361

339-
[19]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/transform/index.ts
340-
[20]: ../customization.md#extending-the-theme
341-
[21]: ../customization.md#overriding-blocks-recommended
362+
[20]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/transform/index.ts
363+
[21]: ../customization.md#extending-the-theme
364+
[22]: ../customization.md#overriding-blocks-recommended
342365

343366
### Custom search
344367

345-
[:octicons-file-code-24: Source][22] ·
368+
[:octicons-file-code-24: Source][23] ·
346369
:octicons-mortar-board-24: Difficulty: _challenging_
347370

348-
Material for MkDocs implements search as part of a [web worker][23]. If you
371+
Material for MkDocs implements search as part of a [web worker][24]. If you
349372
want to switch the web worker with your own implementation, e.g. to submit
350-
search to an external service, you can add a custom JavaScript file to the `docs`
351-
directory and [override the `config` block][21]:
373+
search to an external service, you can add a custom JavaScript file to the
374+
`docs` directory and [override the `config` block][21]:
352375

353376
``` html
354377
{% block config %}
@@ -366,8 +389,8 @@ format using _discriminated unions_, i.e. through the `type` property of the
366389
message. See the following interface definitions to learn about the message
367390
formats:
368391

369-
- [:octicons-file-code-24: `SearchMessage`][24]
370-
- [:octicons-file-code-24: `SearchIndex` and `SearchResult`][25]
392+
- [:octicons-file-code-24: `SearchMessage`][25]
393+
- [:octicons-file-code-24: `SearchIndex` and `SearchResult`][26]
371394

372395
The sequence and direction of messages is rather intuitive:
373396

@@ -376,7 +399,7 @@ The sequence and direction of messages is rather intuitive:
376399
- :octicons-arrow-right-24: `SearchQueryMessage`
377400
- :octicons-arrow-left-24: `SearchResultMessage`
378401

379-
[22]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker
380-
[23]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
381-
[24]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker/message/index.ts
382-
[25]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/_/index.ts
402+
[23]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker
403+
[24]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
404+
[25]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker/message/index.ts
405+
[26]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/_/index.ts

0 commit comments

Comments
 (0)