mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
taxonomy: add h2 subheadings on term page #705
This commit is contained in:
parent
8e7309dfa6
commit
2846b735c7
1 changed files with 21 additions and 6 deletions
|
@ -12,14 +12,29 @@
|
|||
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) (default .Data.Term .Title) }}
|
||||
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||
{{- .Content }}
|
||||
<ul class="columnize">
|
||||
{{- range sort .Pages "Title" }}
|
||||
{{- $c:=""}}{{/* display pages of a term */}}
|
||||
{{- $lastCapital := "" }}
|
||||
{{- $pages := slice }}
|
||||
{{- range .Pages }}
|
||||
{{- if and .Title .RelPermalink (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableTagHiddenPages true) ) }}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}">{{ .Title }}</a></li>
|
||||
{{- $pages = $pages | append (dict "Title" .Title "Page" . )}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range sort $pages ".Title" }}
|
||||
{{- $capital := substr .Title 0 1 | upper }}
|
||||
{{- if ne $lastCapital $capital }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
<h2 id="{{ $capital | plainify | anchorize }}">{{ $capital }}</h2>
|
||||
<ul class="columnize">
|
||||
{{- end }}
|
||||
{{- $c:=""}}{{/* display pages of a term */}}
|
||||
<li><a href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .Page) }}">{{ .Title }}</a></li>
|
||||
{{- $lastCapital = $capital }}
|
||||
{{- end }}
|
||||
{{- if ne $lastCapital "" }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
||||
<footer class="footline">
|
||||
</footer>
|
||||
|
|
Loading…
Reference in a new issue