brainbaking/themes/brainbaking-minimal/layouts/_default/terms.html

50 lines
1.1 KiB
HTML

{{ $.Scratch.Set "curLetter" "" }}
{{ $offset := 1 }}
{{ partial "header" . }}
<a id="top"></a>
<main class="list">
<header>
<h1 id="header" class="p-name">
<svg class='icon'><use xlink:href="#{{ .Params.icontag }}"></use></svg>&nbsp;{{ .Title }}
</h1>
</header>
{{ with .Content }}
<article>
{{ . }}
</article>
{{ end }}
<article class="tagindex">
<div class="taggrid">
{{range $name, $taxonomy := .Site.Taxonomies.tags}}
{{ $cnt := .Count }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
{{ $firstChar := substr $name 0 1 | upper }}
{{ $curLetter := $.Scratch.Get "curLetter" }}
{{ if ne $firstChar $curLetter }}
{{ if ne $curLetter "" }}
</ul>
</div>
{{ end }}
{{ $.Scratch.Set "curLetter" $firstChar }}
<div style="margin-block-start: 0.6rem;">
<h3>{{ $firstChar }}</h3>
<ul>
{{ end }}
{{ if gt $cnt $offset }}
<li>
<a href={{ .RelPermalink }} title="All pages with tag {{$name}}">{{.Title}}</a> ({{$cnt}})
</li>
{{ end }}
{{end}}
{{end}}
</div>
</article>
</main>
{{ partial "footer" . }}