feat: Add button to distinguish category on lists
parent
70189e8e8b
commit
1c2f164871
@ -0,0 +1,27 @@
|
||||
<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>
|
Loading…
Reference in New Issue