HotDog already had `headings .Content` (the table-of-contents pack uses it), so .Headings is gone again: the docs pack's on-this-page list and the search index use the function, and docs/themes.md documents it. The collapsible-block styles from the docs syntax reached every <details> on a page, the table-of-contents box included, and a bare `details > summary` rule reached menus and sidebars outside the text. They now style blocks in a page's text and the typed ones only. The default color moved into :where(), so the kinds keep their own colors.
13 lines
381 B
HTML
13 lines
381 B
HTML
{{/* On this page: the page's h2 and h3 headings, beside it on a wide
|
|
screen. Left out of pages with fewer than two. */}}
|
|
{{ $h := headings .Content }}
|
|
{{ if gt (len $h) 1 }}
|
|
<nav class="onpage" aria-label="On this page">
|
|
<p>On this page</p>
|
|
<ul>
|
|
{{ range $h }}<li class="h{{ .Level }}"><a href="#{{ .ID }}">{{ .Text }}</a></li>
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|
|
{{ end }}
|