{{/* Used by 1. list.html and term.html (when the cardView option is enabled) 2. Recent articles template (when the cardView option is enabled) 3. Shortcode list.html */}} {{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} {{ $images := $.Resources.ByType "image" }} {{ $featured := "" }} {{ $featuredURL := "" }} {{ range slice "*feature*" "*cover*" "*thumbnail*" }} {{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }} {{ end }} {{ if and .Params.featureimage (not $featured) }} {{ $url:= .Params.featureimage }} {{ $featured = resources.GetRemote $url }} {{ end }} {{ if not $featured }} {{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }} {{ end }} {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} {{ with $featured }} {{ $featuredURL = .RelPermalink }} {{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }} {{ $featuredURL = (.Resize "600x").RelPermalink }} {{ end }} {{ end }}