hugo-theme/layouts/_default/terms.html
2024-10-21 13:47:30 +02:00

24 lines
986 B
HTML

{{ define "main" }}
{{ $type := .Type }}
<div class="flex flex-col gap-y-3 p-6 mt-6 mx-2 md:mx-0 rounded-lg shadow-md bg-white dark:bg-gray-700 w-full max-w-4xl lg:max-w-5xl">
<h1 class="text-4xl font-semibold text-slate-800 dark:text-slate-200">
<a href="{{ .RelPermalink }}">{{ T (printf "taxonomies.%s" $type) | safeHTML }}</a>
</h1>
<ul class="flex flex-col gap-3">
{{ range $key, $value := .Data.Terms.ByCount }}
{{ $term := .Term }}
{{ $count := .Count }}
{{ with $.Site.GetPage (printf "/%s/%s" $type $term) }}
<li class="">
<a href="{{ .RelPermalink }}"
class="flex flex-row text-slate-600 dark:text-slate-300 backdrop-blur">
<span class="text-lg mr-2">{{ $term }}</span>
<span class="self-center rounded-full text-xs px-2 bg-red-400 text-white">{{ $count }}</span>
</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}