2023-05-20 11:05:41 +00:00
|
|
|
{{- if eq .Kind "taxonomy" }}
|
|
|
|
<nav id="TableOfContents">
|
|
|
|
<ul>
|
|
|
|
{{- $lastCapital := "" }}
|
2023-10-29 23:44:41 +00:00
|
|
|
{{- $terms := slice }}
|
|
|
|
{{- range .Data.Terms }}
|
|
|
|
{{- $terms = $terms | append (dict "Title" (default .Page.Data.Term .Page.Title) "Term" . )}}
|
|
|
|
{{- end }}
|
|
|
|
{{- range sort $terms ".Title" }}
|
|
|
|
{{- $capital := substr .Title 0 1 | upper }}
|
|
|
|
{{- $len := 0 }}
|
|
|
|
{{- range .Term.Pages }}
|
|
|
|
{{- $c:=""}}{{/* count pages of term */}}
|
|
|
|
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
|
|
|
{{- $len = add $len 1 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if $len }}
|
|
|
|
{{- if ne $lastCapital $capital }}
|
|
|
|
<li><a href="#{{ $capital | plainify | anchorize }}">{{ $capital }}</a></li>
|
|
|
|
{{- end }}
|
|
|
|
{{- $lastCapital = $capital }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{- else if eq .Kind "term" }}
|
|
|
|
<nav id="TableOfContents">
|
|
|
|
<ul>
|
|
|
|
{{- $lastCapital := "" }}
|
|
|
|
{{- $pages := slice }}
|
|
|
|
{{- range .Pages }}
|
|
|
|
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
|
|
|
{{- $pages = $pages | append (dict "Title" .Title "Page" . )}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range sort $pages ".Title" }}
|
|
|
|
{{- $capital := substr .Title 0 1 | upper }}
|
2023-05-20 11:05:41 +00:00
|
|
|
{{- if ne $lastCapital $capital }}
|
2023-09-30 19:45:39 +00:00
|
|
|
<li><a href="#{{ $capital | plainify | anchorize }}">{{ $capital }}</a></li>
|
2023-05-20 11:05:41 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- $lastCapital = $capital }}
|
|
|
|
{{- end }}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
{{- else }}
|
|
|
|
{{- .TableOfContents }}
|
2023-09-14 22:23:41 +00:00
|
|
|
{{- end }}
|