pages/layouts/partials/category-button.html

27 lines
889 B
HTML

<div class="category-button">
{{ with .Param "categories" }}
{{ range $i, $category := . }}
{{ if eq $i 0 }}
{{ with $.Site.GetPage (printf "/%s/%s" "categories" $category) }}
{{ $iconDictionary := dict
"video" "fad fa-video"
"paper" "fad fa-book"
"poster" "fad fa-presentation"
"thesis" "fad fa-graduation-cap"
"presentation" "fad fa-podium"
"web" "fad fa-globe"
}}
{{ $categoryIcon := index $iconDictionary $category }}
<a
href="{{ .RelPermalink }}"
class="btn btn-dark btn-sm"
data-bs-toggle="tooltip"
title="{{ humanize $category }}"
>
<i class="{{ $categoryIcon | default "fad fa-tag" }} fa-fw"></i>
</a>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>