You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
786 B

{{- $cover := false -}}
{{- $autoCover := default $.Site.Params.autoCover false }}
{{- if index .Params "cover" -}}
{{- if .Resources.GetMatch .Params.Cover }}
{{- $cover = (.Resources.GetMatch .Params.Cover).RelPermalink -}}
{{- else -}}
{{- $cover = absURL .Params.Cover -}}
{{- end -}}
{{- else if $.Site.Params.AutoCover -}}
{{- if (not .Params.Cover) -}}
{{- if .Resources.GetMatch "cover.*" -}}
{{- $cover = (.Resources.GetMatch "cover.*").RelPermalink -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{if $cover -}}
<!-- Cover image found -->
<a href="https://{{ .Params.urlLink }}">
<img src="{{ $cover }}"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
</a>
{{- end }}