{{ $cover := (.Resources.GetMatch "cover.*") }} {{ if not $cover }} {{ $cover := (index (.Resources.ByType "image") 0) }} {{ if not $cover }} {{ $cover = resources.Get "images/default-events-cover.png" }} {{ end }} {{ end }} {{ with $cover }} {{ end }}