Skip to content

Commit 33bdc4e

Browse files
authored
refactor: move manual reuse of sidebar via ID sot side navigation
1 parent 3031e6d commit 33bdc4e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/websites/website-navigation.qmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,14 @@ Here are all of the options available for side navigation:
179179
| `collapse-level` | Whether to show sidebar navigation collapsed by default. The default is 2, which shows the top and next level fully expanded (but leaves the 3rd and subsequent levels collapsed). |
180180
| `pinned` | Always show a title bar that expands to show the sidebar at narrower screen widths (true or false). Defaults to false, and uses [headroom.js](https://wicky.nillia.ms/headroom.js/) to automatically show the navigation bar when the user scrolls up on the page. |
181181

182-
A single `sidebar` item without an `id` or `title` will result in a global sidebar applied to all pages. A sidebar with an `id` or `title` will only be applied to pages within the contents of the sidebar or pages that specify the sidebar id.
182+
A single `sidebar` item without an `id` or `title` will result in a global sidebar applied to all pages. A sidebar with an `id` or `title` will only be applied to pages within the contents of the sidebar or pages that specify the sidebar id.
183+
184+
To use a specific sidebar on a page or a group of pages, specify the `sidebar` ID in the front matter of the page or in the `_metadata.yml` file.
185+
For example, to include the tutorials sidebar on a page, add the following to the page's front matter:
186+
187+
```yaml
188+
sidebar: <id>
189+
```
183190

184191
For more information on controlling the appearance of the side navigation using HTML themes, see [HTML Themes - Navigation](/docs/output-formats/html-themes.qmd#navigation). If you need to control the width of the sidebar, see [Page Layout - Grid Customization](/docs/output-formats/page-layout.qmd#grid-customization).
185192

@@ -378,13 +385,6 @@ website:
378385
# navigation items
379386
```
380387

381-
To use a specific sidebar on a page or a group of pages, specify the `sidebar` ID in the front matter of the page or in the `_metadata.yml` file.
382-
For example, to include the tutorials sidebar on a page, add the following to the page's front matter:
383-
384-
```yaml
385-
sidebar: tutorials
386-
```
387-
388388
## Breadcrumbs
389389

390390
By default, navigational breadcrumbs are displayed above the page title on each page that is nested deeper than one level in the sidebar navigation. For example, given this `sidebar` definition:

0 commit comments

Comments
 (0)