{{- with .cxt -}} {{- $coverParam := .Params.cover.image -}} {{- $bundleCover := "" -}} {{- if .Resources -}} {{- $bundleCover = (.Resources.ByType "image").GetMatch "{featured,cover}*" -}} {{- end -}} {{- $hasCover := or $coverParam $bundleCover -}} {{- if and $hasCover (not $.isHidden) -}}
{{- $loading := cond $.IsSingle "eager" "lazy" -}} {{- $addLink := and site.Params.cover.linkFullImages $.IsSingle -}} {{- $cover := $bundleCover -}} {{- if $coverParam -}} {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" $coverParam) -}} {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" $coverParam) -}} {{- $cover = or $pageBundleCover $globalResourcesCover $bundleCover -}} {{- end -}} {{- $alt := .Params.cover.alt | default .Params.cover.caption | default .Title | plainify -}} {{- $imgdl := "" -}} {{- if $cover -}} {{- $imgdl = $cover.Permalink -}} {{- else if $coverParam -}} {{- $imgdl = $coverParam | absURL -}} {{- end -}} {{- if $addLink -}} {{- end -}} {{ $alt }} {{- if $addLink -}} {{- end -}} {{- if $.IsSingle -}} {{- with .Params.cover.caption -}}
{{ . | markdownify }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}