diff options
Diffstat (limited to 'themes/terminal/layouts/partials/cover.html')
-rw-r--r-- | themes/terminal/layouts/partials/cover.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/themes/terminal/layouts/partials/cover.html b/themes/terminal/layouts/partials/cover.html new file mode 100644 index 0000000..ea562ea --- /dev/null +++ b/themes/terminal/layouts/partials/cover.html @@ -0,0 +1,24 @@ +{{- $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 }} |