post: display the postimage if it exists

Co-Authored-by: iGor milhit <igor@milhit.ch>
merge-requests/5/merge
iGor milhit 2021-09-12 15:07:16 +02:00
parent 9ac94f1d5c
commit 7bba092f68
Signed by: igor
GPG Key ID: 692D97C3D0228A99
2 changed files with 15 additions and 7 deletions

View File

@ -5,13 +5,16 @@
///////////////////
.post-header {
margin: 1rem 0 .5rem 0;
h1 {
margin: 0;
}
}
.post-image {
width: 100%;
border-radius: .2rem;
}
.post-info {
font-size: $font-size-small;
color: $snow-storm-light-grey;

View File

@ -1,12 +1,17 @@
{{ define "main" }}
<header class="post-header">
{{ if .Params.postimage -}}
<img class="post-image"
src="/images/{{ .Params.postimage }}"
alt="{{ .Params.postimagedescription }}">
{{ end }}
<h1 id="title">{{ .Title }}</h1>
{{- partial "post-info.html" . -}}
</header>
<article {{ if eq .Layout "verse" }} class="content, {{ .Layout }}"
{{ else }} class="content"
{{ end }}>
{{ .Content }}
</article>
<article {{ if eq .Layout "verse" }} class="content, {{ .Layout }}"
{{ else }} class="content"
{{ end }}>
{{ .Content }}
</article>
{{ end }}