hugo-theme-relearn/layouts/partials/toc.html
2023-09-13 23:23:38 +02:00

20 lines
No EOL
554 B
HTML

<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 }}
{{- .TableOfContents }}
{{- end }}
</div>
</div>