Files
jcoffey-dev 2d91d8a220
ci / go (pull_request) Successful in 55s
ci / editor-ui (pull_request) Successful in 1m28s
Use the headings function there is; keep block styles to page text
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.
2026-10-12 20:14:44 -07:00

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 }}