File: breadcrumbs.md

package info (click to toggle)
sphinx-basic-ng 1.0.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 504 kB
  • sloc: python: 179; makefile: 5
file content (44 lines) | stat: -rw-r--r-- 1,475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Breadcrumbs

A breadcrumb navigation provide links back to each "parent" page of the current
page, showing the user's current location in a website and giving them a good
way to navigate within it.

## Usage

```jinja
{% include "components/breadcrumbs.html" %}
```

When there are no list-items to show in the breadcrumb, this component will
render empty.

In all other cases, the structure looks like:

- a single `nav.breadcrumb-nav`
  - a single `ol.breadcrumb-nav-list`
    - one-or-more `breadcrumb-nav-list-item` containing a single `a[href]` tag.
    - a single `breadcrumb-nav-list-item` contain a single `span` tag.

```{tip}
See [this page][w3schools-breadcrumbs] for an example of how to stylise
breadcrumbs with this structure.
```

## Configurability

There are 2 values that can be provided via the html-context, which provide
control over the components shown in the breadcrumbs:

- `breadcrumb_include_index_as`: If provided, this name is used as the first
  list-item of the breadcrumb on pages other than the `index` page.The
  corresponding list-item will have an additional class:
  `breadcrumb-nav-index-item`.

- `breadcrumb_include_page`: If truthy, the current page is included in the
  breadcrumb as the final list-item, with only a `span` (there's no `a[href]` in
  it). The corresponding list-item will have an additional class:
  `breadcrumb-nav-page-item`.

[w3schools-breadcrumbs]:
  https://www.w3schools.com/howto/howto_css_breadcrumbs.asp