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 { .post-header {
margin: 1rem 0 .5rem 0;
h1 { h1 {
margin: 0; margin: 0;
} }
} }
.post-image {
width: 100%;
border-radius: .2rem;
}
.post-info { .post-info {
font-size: $font-size-small; font-size: $font-size-small;
color: $snow-storm-light-grey; color: $snow-storm-light-grey;

View File

@ -1,5 +1,10 @@
{{ define "main" }} {{ define "main" }}
<header class="post-header"> <header class="post-header">
{{ if .Params.postimage -}}
<img class="post-image"
src="/images/{{ .Params.postimage }}"
alt="{{ .Params.postimagedescription }}">
{{ end }}
<h1 id="title">{{ .Title }}</h1> <h1 id="title">{{ .Title }}</h1>
{{- partial "post-info.html" . -}} {{- partial "post-info.html" . -}}
</header> </header>