From 65695c7fa2684d7221a5069cbc27e7f0cfffd892 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Sun, 15 Oct 2023 04:43:42 +0200 Subject: Get featured image into the post list & single --- layouts/partials/post.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'layouts/partials') diff --git a/layouts/partials/post.html b/layouts/partials/post.html index a950810..fa6d485 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -2,7 +2,13 @@

{{ .Title }}

- {{ with resources.Get (index .Params.images 0) }} + {{ $image := "" }} + {{ if resources.Get (index .Params.images 0) }} + {{ $image = resources.Get (index .Params.images 0) }} + {{ else if (.Resources.ByType "image").GetMatch "*featured*" }} + {{ $image = (.Resources.ByType "image").GetMatch "*featured*" }} + {{ end }} + {{ with $image }} {{ $image := .Resize (default "320x" .Params.thumbnail_size) }}
@@ -14,7 +20,7 @@
- {{ if isset .Params "metadata" }} + {{ if in (slice "post" "talk") .Section }} {{ partial "metadata.html" . }} {{ end }} -- cgit v1.2.3