From 7bba092f68488116a7b010ee4bdddd7c1cbee071 Mon Sep 17 00:00:00 2001 From: iGor milhit Date: Sun, 12 Sep 2021 15:07:16 +0200 Subject: [PATCH] post: display the postimage if it exists Co-Authored-by: iGor milhit --- assets/scss/_post.scss | 7 +++++-- layouts/_default/single.html | 15 ++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/assets/scss/_post.scss b/assets/scss/_post.scss index b3b5442..aa21c1e 100644 --- a/assets/scss/_post.scss +++ b/assets/scss/_post.scss @@ -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; diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d76ef74..6e85bac 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,12 +1,17 @@ {{ define "main" }}
+ {{ if .Params.postimage -}} + {{ .Params.postimagedescription }} + {{ end }}

{{ .Title }}

{{- partial "post-info.html" . -}}
-
- {{ .Content }} -
+
+ {{ .Content }} +
{{ end }}