pages/layouts/partials/category-button.html

25 lines
763 B
HTML
Raw Normal View History

2024-11-23 02:37:42 +00:00
{{ 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
class="category-button"
href="{{ .RelPermalink }}"
title="{{ humanize $category }}"
>
<i class="{{ $categoryIcon | default "fad fa-tag" }} fa-fw"></i>
</a>
{{ end }}
{{ end }}
{{ end }}
2024-11-23 02:37:42 +00:00
{{ end }}