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

56 lines
1.5 KiB
HTML
Raw Normal View History

2020-05-27 20:35:46 +02:00
{{ partial "header" . }}
{{ partial "bigimg" . }}
<a id="top"></a>
<main class="list">
2020-05-27 20:35:46 +02:00
<header>
<h1>
<svg class='icon'><use xlink:href="#{{ .Params.icontag }}"></use></svg>&nbsp;{{ .Title }}
</h1>
</header>
2020-05-27 20:35:46 +02:00
2020-05-27 21:20:01 +02:00
<hr/>
{{ with .Content }}
<article>
2020-05-27 21:20:01 +02:00
{{ . }}
</article>
2020-05-27 21:20:01 +02:00
{{ end }}
<article>
<div class="list">
<!-- https://discourse.gohugo.io/t/lists-of-content-divided-by-posts-first-letter/8534/2 - create a list with all uppercase letters -->
{{ $letters := split "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "" }}
<!-- range all pages sorted by their title -->
{{ range .Data.Pages.ByTitle }}
<!-- get the first character of each title. Assumes that the title is never empty! -->
{{ $firstChar := substr .Title 0 1 | upper }}
<!-- in case $firstChar is a letter -->
{{ if $firstChar | in $letters }}
<!-- get the current letter -->
{{ $curLetter := $.Scratch.Get "curLetter" }}
<!-- if $curLetter isn't set or the letter has changed -->
{{ if ne $firstChar $curLetter }}
<!-- update the current letter and print it -->
</span></li></ul><div style="clear: both;"></div>
{{ $.Scratch.Set "curLetter" $firstChar }}
<h3>{{ $firstChar }}</h3>
<ul class="list-ul" style="padding-top: 1rem"><li><span class='list-tags'>
{{ end }}
<a href="{{ .RelPermalink }}"><kbd class="item-tag">{{ .Title }}</kbd></a>
{{ end }}
{{ end }}
</div>
</article>
2020-05-27 21:20:01 +02:00
</main>
2020-05-27 20:35:46 +02:00
{{ partial "footer" . }}