2021-05-05 02:33:35 +00:00
|
|
|
{{- $cover := false -}}
|
|
|
|
{{- $autoCover := default $.Site.Params.autoCover false }}
|
2021-11-01 17:53:02 +00:00
|
|
|
|
2021-05-08 06:49:17 +00:00
|
|
|
{{- if index .Params "cover" -}}
|
2021-05-05 02:33:35 +00:00
|
|
|
{{- if .Resources.GetMatch .Params.Cover }}
|
|
|
|
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $cover = absURL .Params.Cover -}}
|
|
|
|
{{- end -}}
|
2021-05-08 06:49:17 +00:00
|
|
|
{{- else if $.Site.Params.AutoCover -}}
|
2021-11-01 17:53:02 +00:00
|
|
|
{{- if (not .Params.Cover) -}}
|
|
|
|
{{- if .Resources.GetMatch "cover.*" -}}
|
|
|
|
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
|
|
|
|
{{- end -}}
|
2021-05-08 06:49:17 +00:00
|
|
|
{{- end -}}
|
2021-05-05 02:33:35 +00:00
|
|
|
{{- end -}}
|
2021-11-01 17:53:02 +00:00
|
|
|
|
2021-05-05 02:33:35 +00:00
|
|
|
{{if $cover -}}
|
|
|
|
<!-- Cover image found -->
|
2021-05-05 04:37:33 +00:00
|
|
|
<img src="{{ $cover }}"
|
|
|
|
class="post-cover"
|
|
|
|
alt="{{ .Title | plainify | default " " }}"
|
|
|
|
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
|
2021-11-01 17:53:02 +00:00
|
|
|
{{- end }}
|