From cea5cbc3d926de96f9bbfe4621717bd20e796317 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 3 Feb 2025 13:53:13 +0000 Subject: [PATCH] feat: add warning if avatar image not found --- .../blox-tailwind/layouts/partials/views/article-grid.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/blox-tailwind/layouts/partials/views/article-grid.html b/modules/blox-tailwind/layouts/partials/views/article-grid.html index f5f65e3d..1b30750a 100644 --- a/modules/blox-tailwind/layouts/partials/views/article-grid.html +++ b/modules/blox-tailwind/layouts/partials/views/article-grid.html @@ -61,11 +61,12 @@
- {{ if .Params.authors }} + {{ if $item.Params.authors }}
{{ range $index, $value := first 1 ($item.GetTerms "authors") }}
{{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} + {{ if $avatar }} {{ $authorImage := $avatar.Process "Fill 50x50 Center 95 webp" }} avatar + {{ else }} + {{ warnf "An image named `avatar` was not found in the `%s` folder" $value.Path }} + {{ end }}
{{- .Page.LinkTitle -}}