matrix-spec/layouts/_partials/toc.html

30 lines
690 B
HTML
Raw Normal View History

{{/*
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>
{{/* */ -}}