hugo-theme/layouts/partials/block/sidebar_section.html
2024-10-21 13:47:30 +02:00

29 lines
986 B
HTML

{{- $taxonomy := .Taxonomy -}}
{{- $context := .Context -}}
{{- $limit := .Limit -}}
{{ $icon := (index site.Params.taxonomies.icons $taxonomy) | default "tags" }}
<section class="flex flex-col w-full gap-y-3 pl-6 py-3 mt-6 text-slate-800 dark:text-slate-200">
<div class="flex flex-row">
<a class="flex flex-row" href='{{ (site.GetPage $taxonomy).RelPermalink }}'>
<i class="h-6 w-6 flex-none">
{{ partial "icon.html" $icon }}
</i>
<h2 class="pl-1 uppercase">
{{ T (printf "taxonomies.%s" $taxonomy) | safeHTML }}
</h2>
</a>
</div>
<ul class="flex flex-row flex-wrap">
{{ range first $limit $context.ByCount }}
<li class="mt-2 mr-2">
<a href="{{ .Page.RelPermalink }}"
class="rounded px-2 py-1 text-sm text-slate-800 dark:text-slate-300 ring-1 ring-slate-900/5 dark:ring-slate-50/5 backdrop-blur bg-slate-50 dark:bg-gray-700">
{{ .Page.Title }}
</a>
</li>
{{ end }}
</ul>
</section>