From e222e48f3a3edf616d23d1a897919312562c6092 Mon Sep 17 00:00:00 2001 From: Ismaila Abdoulahi <36740618+auloin@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:38:44 +0200 Subject: [PATCH] Skip resource if not found --- themes/casper3/layouts/_default/single.html | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/themes/casper3/layouts/_default/single.html b/themes/casper3/layouts/_default/single.html index 5c09583..8afb840 100644 --- a/themes/casper3/layouts/_default/single.html +++ b/themes/casper3/layouts/_default/single.html @@ -64,16 +64,18 @@

{{ .Param "author" }}

{{ if .Param "feature_image" }} - {{ $image := resources.Get (.Param "feature_image") }} - {{ if .Param "aspect_ratio" }} -
- {{ else if eq .Section "use-case" }} -
- {{ else if eq .Section "blog" }} -
- {{ end }} - {{ $image.Title }} -
+ {{ $image := resources.Get (.Param "feature_image") }} + {{ if .Param "aspect_ratio" }} +
+ {{ else if eq .Section "use-case" }} +
+ {{ else if eq .Section "blog" }} +
+ {{ end }} + {{ with $image }} + {{ $image.Title }} + {{ end }} +
{{ end }}