mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
tags: show taxonomy toc for standard installation #533
This commit is contained in:
parent
a2dd392585
commit
6bca95ae28
1 changed files with 16 additions and 1 deletions
|
@ -1,5 +1,20 @@
|
|||
<div class="default-animation progress">
|
||||
<div class="toc-wrapper">
|
||||
{{- .TableOfContents }}
|
||||
{{- 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>
|
Loading…
Reference in a new issue