Update cover styling and show the cover caption also on the list of contents

This commit is contained in:
panr 2020-07-07 18:56:33 +02:00
parent d4d477e3b6
commit c08fe10125
4 changed files with 24 additions and 12 deletions

View File

@ -37,11 +37,17 @@
{{ end }} {{ end }}
{{ if .Params.Cover }} {{ if .Params.Cover }}
{{ if .Params.UseRelativeCover }} <figure class="post-cover">
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" class="post-cover" /> {{ if .Params.UseRelativeCover }}
{{ else }} <img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" />
<img src="{{ .Params.Cover | absURL }}" class="post-cover" /> {{ else }}
{{ end }} <img src="{{ .Params.Cover | absURL }}" />
{{ 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

@ -28,11 +28,17 @@
{{ end }} {{ end }}
{{ if .Params.Cover }} {{ if .Params.Cover }}
{{ if .Params.UseRelativeCover }} <figure class="post-cover">
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" class="post-cover" /> {{ if .Params.UseRelativeCover }}
{{ else }} <img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}" />
<img src="{{ .Params.Cover | absURL }}" class="post-cover" /> {{ else }}
{{ end }} <img src="{{ .Params.Cover | absURL }}" />
{{ 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

@ -51,12 +51,12 @@
} }
&-cover { &-cover {
border-radius: 8px;
margin: 40px -50px; margin: 40px -50px;
width: 860px; width: 860px;
max-width: 860px; max-width: 860px;
img { img {
border-radius: 8px;
box-shadow: 0 12px 40px rgba(0, 0, 0, .15); box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
} }

File diff suppressed because one or more lines are too long