This repository has been archived on 2023-09-28. You can view files and clone it, but cannot push or open issues or pull requests.
homepage/themes/terminal/layouts/partials/cover.html

25 lines
759 B
HTML
Raw Normal View History

2023-03-15 16:41:01 +00:00
{{- $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 -->
<img src="{{ $cover }}"
class="post-cover"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
{{- end }}