Set a fall-back image

{{- with or (.Resources.Get "cover.jpg") (resources.Get "fallback.jpg") }}
  {{- with .Fill "300x192 webp" }}
    <img src="{{ .Permalink }}" alt="{{ .Title }}" width="{{ .Width }}" height="{{ .Height }}" loading="lazy"/>
  {{- end }}
{{- end }}
1 Like