I’m trying to use an image page resource for thumbnail generation. If there’s no image with such name, then fallback to another image.
{{ $thumb := .Resources.GetMatch "thumb.*" }}
{{ if not $thumb }}
{{ $thumb := .Resources.GetMatch "0.*" }}
{{ end }}
{{ $thumb := $thumb.Resize "500x" }}
Apparently, this is not the way to do it as I don’t get the fallback image (0.jpg) if thumb.jpg is missing.
Either this is not the right way to check if $thumb contains a resource, or whatever happens inside the conditional statement is not usable outside of it.