backy/docs/themes/hugo-theme-relearn/exampleSite/layouts/partials/toc.html

23 lines
624 B
HTML
Raw Normal View History

<div class="default-animation progress">
<div class="toc-wrapper">
{{- if eq .Kind "taxonomy" }}
<nav id="TableOfContents">
<ul>
{{- $lastCapital := "" }}
{{- range .Data.Terms.Alphabetical }}
{{- $capital := substr .Page.Title 0 1 | upper }}
{{- if ne $lastCapital $capital }}
<li><a href="#{{ $capital | anchorize }}">{{ $capital }}</a></li>
{{- end }}
{{- $lastCapital = $capital }}
{{- end }}
</ul>
</nav>
{{- else }}
{{- partial "shortcodes/piratify.html" (dict
"context" .
"pagefield" "TableOfContents"
) }}
{{- end }}
</div>
</div>