diff --git a/assets/styles/mix-twbs.scss b/assets/styles/mix-twbs.scss index 3f2f084..850cf9f 100644 --- a/assets/styles/mix-twbs.scss +++ b/assets/styles/mix-twbs.scss @@ -161,3 +161,14 @@ h1 { .card-link { white-space: nowrap; } + +.category-button { + position: absolute; + top: 1em; + right: 1em; + display: grid; +} + +.card-title { + margin-right: 2.25em; +} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b530e03..3a813fd 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -11,6 +11,9 @@ {{ range .Pages }}
+ {{ partial "category-button" . }} + +
{{/* Thumbnail images should be stored as 'thumbnail'.* in the page bundle, but historically they might have been referenced as 'thumbnail' in the front @@ -53,7 +56,7 @@ {{ .Summary }} Read more »Read more »

diff --git a/layouts/partials/category-button.html b/layouts/partials/category-button.html new file mode 100644 index 0000000..e6c5d7c --- /dev/null +++ b/layouts/partials/category-button.html @@ -0,0 +1,27 @@ +
+ {{ 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 }} + + + + {{ end }} + {{ end }} + {{ end }} + {{ end }} +