From 0db9a0094d158b60db8539b1c1f8564ebf15993c Mon Sep 17 00:00:00 2001 From: Manuel Fedele Date: Wed, 25 Nov 2020 11:12:45 +0100 Subject: [PATCH] Sane defaults for FullWidthTheme and CenterTheme Providing sane defaults in order to use the template with no additional configuration at all. At the moment you can't just do ``` hugo new site mysyte cd mysyte git init git submodule add https://github.com/panr/hugo-theme-terminal.git themes/terminal hugo server -t terminal ``` because FullWitdthTheme and CentralTheme params are not set. ``` themes/terminal/layouts/_default/baseof.html:10:23": execute of template failed: template: _default/terms.html:10:23: executing "_default/terms.html" at <$.Site.Params.FullWidthTheme>: invalid value; expected bool ``` With this little fix the theme starts with no additional configuration than the standard one created by hugo cli. --- layouts/_default/baseof.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 44edc4a..06b6d8f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,7 +7,7 @@ {{ partial "head.html" . }} -{{ $container := cond $.Site.Params.FullWidthTheme "container full" (cond $.Site.Params.CenterTheme "container center" "container") }} +{{ $container := cond ($.Site.Params.FullWidthTheme | default false) "container full" (cond ($.Site.Params.CenterTheme | default true) "container center" "container") }}