matrix-spec/layouts/_partials/toc.html
Kévin Commaille 9c4ddb6fa8
Update toc.html
Bring in upstream changes and make it closer to upstream. This requires
to change also toc.js and the CSS styles.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-01-07 13:36:36 +01:00

30 lines
690 B
HTML

{{/*
A copy of the toc.html partial in Docsy, modified to:
* show the page's title instead of "on this page"
*/ -}}
{{/*
Always render the td-toc element. ScrollSpy is counting on it to exist,
even if it's empty.
cSpell:ignore notoc
*/ -}}
<div class="td-toc" data-proofer-ignore>
{{ if not .Params.notoc -}}
{{ $toc := .TableOfContents -}}
{{ if and $toc (ne $toc `<nav id="TableOfContents"></nav>`) -}}
<div class="td-toc-title">
<span class="td-toc-title__text">{{ .Params.Title }}</span>
<a class="td-toc-title__link" title="{{ i18n "toc_top_of_page" }}" href="#"></a>
</div>
{{ $toc | safeHTML }}
{{ end -}}
{{ end -}}
</div>
{{/* */ -}}