pages/layouts/partials/category-button.html

26 lines
727 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" "video"
"paper" "book"
"poster" "presentation"
"thesis" "graduation-cap"
"presentation" "podium"
"web" "globe"
2024-12-05 17:14:31 +00:00
"blog" "block-quote"
2024-11-23 02:37:42 +00:00
}}
{{ $categoryIcon := index $iconDictionary $category }}
<a
class="category-button"
href="{{ .RelPermalink }}"
title="{{ humanize $category }}"
>
{{- partial "fa.html" $categoryIcon -}}
2024-11-23 02:37:42 +00:00
</a>
{{ end }}
{{ end }}
{{ end }}
2024-11-23 02:37:42 +00:00
{{ end }}