move post cover to partial

This commit is contained in:
Thomas Jensen 2021-01-09 22:58:50 +01:00
parent 2c2588d1c6
commit 02105f748b
4 changed files with 14 additions and 33 deletions

View file

@ -47,17 +47,7 @@
{{ end }} {{ end }}
{{ if .Params.Cover }} {{ if .Params.Cover }}
<figure class="post-cover"> {{ partial "postcover.html" . }}
{{ if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
{{ else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
{{ end }}
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">

View file

@ -35,17 +35,7 @@
{{ end }} {{ end }}
{{ if .Params.Cover }} {{ if .Params.Cover }}
<figure class="post-cover"> {{ partial "postcover.html" . }}
{{ if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
{{ else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
{{ end }}
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">

View file

@ -39,17 +39,7 @@
{{ end }} {{ end }}
{{ if .Params.Cover }} {{ if .Params.Cover }}
<figure class="post-cover"> {{ partial "postcover.html" . }}
{{ if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
{{ else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}" />
{{ end }}
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }} {{ end }}
<div class="post-content"> <div class="post-content">

View file

@ -0,0 +1,11 @@
<figure class="post-cover">
{{ if .Params.UseRelativeCover }}
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
{{ else }}
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Params.CoverAlt | plainify | default .Title }}"/>
{{ end }}
{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>