Add coverCaption

This commit is contained in:
Djordje Atlialp 2021-01-10 16:58:03 +01:00
parent bc1a483ef0
commit 0091c33d92
2 changed files with 18 additions and 6 deletions

View file

@ -14,6 +14,16 @@
<article>
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
{{ if .Params.Cover }}
<figure class="post-cover">
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{ if .Params.toc }}
<hr />
<aside id="toc">
@ -23,10 +33,6 @@
<hr />
{{ end }}
{{ with .Params.Cover }}
<img src="{{ . | relURL }}" class="post-cover" />
{{ end }}
<div class="post-content">
{{ .Content }}
</div>

View file

@ -26,8 +26,14 @@
<div class="post-excerpt">{{ . }}</div>
{{ end }}
{{ with .Params.Cover }}
<img src="/{{ . }}" class="post-cover" />
{{ if .Params.Cover }}
<figure class="post-cover">
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}
{{- if .Params.toc }}