feat: coverCaption

This commit is contained in:
Mirus
2024-08-23 12:29:28 +03:00
parent e1866ffa63
commit 9795a7535f
6 changed files with 93 additions and 65 deletions

View File

@@ -16,9 +16,22 @@
{{- end -}}
{{if $cover -}}
<!-- Cover image found -->
<img src="{{ $cover }}"
class="post-cover"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
{{ if .Params.coverCaption }}
<figure>
<!-- Cover image found -->
<img src="{{ $cover }}"
class="post-cover"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
<figcaption class="right">{{ .Params.coverCaption | safeHTML }}</figcaption>
</figure>
{{ else }}
<!-- Cover image found -->
<img src="{{ $cover }}"
class="post-cover"
alt="{{ .Title | plainify | default " " }}"
title="{{ .Params.CoverCredit |plainify|default "Cover Image" }}" />
{{ end }}
{{- end }}