{{ $image := "" }} {{ if (.Resources.ByType "image").GetMatch "*featured*" }} {{ $image = (.Resources.ByType "image").GetMatch "*featured*" }} {{ else if resources.Get (index .Params.images 0) }} {{ $image = resources.Get (index .Params.images 0) }} {{ end }} {{ with $image }} <div class="tc"> <div class="relative dib"> <img src="{{ if ne .MediaType.SubType "svg" }} {{ $image := .Fit (default "768x400" $.Params.image_size) }} {{ $image.RelPermalink }} {{ else }} {{ $image.RelPermalink }} {{ end }}" class="m-0" alt="{{ .Title }}" /> {{ with $.Params.caption }} <a href="{{ .url }}" class="near-white block absolute bottom-0 right-0 p-2 bg-black-30 br2" > {{ .text }} </a> {{ end }} </div> </div> {{ end }}