{{- if .Params.cover.image -}}
{{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- if $cover -}}{{/* i.e it is present in page bundle */}}
{{- else }}{{/* For absolute urls and external links */}}
{{- if (ne $.Params.cover.relative true) }}
{{- else }}
{{- end}}
{{- end -}}
{{- else }}
{{- with $.Params.images -}}
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{- else -}}
{{- with site.Params.images -}}
{{ else -}}
{{- end -}}
{{- end -}}
{{- end }}
{{- end }}
{{ with site.Social.twitter -}}
{{ end -}}