From 983330c98cd884a47ab9947dd592365291dd4d02 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Sun, 13 Feb 2022 14:32:43 +0100 Subject: [PATCH] allow hiding of sidebar; show content frame only if content present --- layouts/_default/single.html | 13 ++++++++----- layouts/partials/sidebar.html | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 47f6d12..c179236 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,8 @@ {{ define "main" -}}
-
+ {{- $mainwidth := or (and .Params.noSidebar "12") "8" -}} +
{{ if .Title -}} @@ -20,12 +21,14 @@ {{- end }} {{- end }} -
- {{ .Content }} -
+ {{ with .Content -}} +
{{ . }}
+ {{- end }}
- {{ partial "sidebar.html" . }} + {{ if not .Params.noSidebar -}} + {{ partial "sidebar.html" . }} + {{- end }}
{{ if eq .Site.Params.showChildArticles "cards" -}} diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index eb7693a..1cc5b34 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -25,7 +25,7 @@ {{- end -}} {{- else if .Params.teaser -}}
-
+
{{ .Params.teaser }}
@@ -35,7 +35,7 @@ alt="Default Dmage"> {{- else if .Params.Summary -}}
-
+
{{ .Params.Summary }}