From aa8b3f35badcea42089b525beb89e75efb58011c Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 24 Mar 2019 19:24:58 +0000 Subject: [PATCH] feat(widget): add option to customize section spacing Close #433 --- exampleSite/content/home/demo.md | 6 +++++- layouts/partials/widget_page.html | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/exampleSite/content/home/demo.md b/exampleSite/content/home/demo.md index 92363e88..f36c0ff1 100644 --- a/exampleSite/content/home/demo.md +++ b/exampleSite/content/home/demo.md @@ -35,9 +35,13 @@ subtitle = "" # Text color (true=light or false=dark). text_color_light = true +[design.spacing] + # Customize the section spacing. Order is top, right, bottom, left. + padding = ["20px", "0", "20px", "0"] + [advanced] # Custom CSS. - css_style = "padding-top: 20px; padding-bottom: 20px;" + css_style = "" # CSS class. css_class = "" diff --git a/layouts/partials/widget_page.html b/layouts/partials/widget_page.html index 183f10b1..f5e69ef6 100644 --- a/layouts/partials/widget_page.html +++ b/layouts/partials/widget_page.html @@ -36,6 +36,11 @@ {{ $style = printf "%sbackground-image: %s url('%s');" $style $darken (printf "img/%s" $bg.image | absURL) }} {{ end }} + {{ with $st.Params.design.spacing.padding }} + {{ $style_pad := printf "padding: %s;" (delimit . " ") }} + {{ $style = print $style $style_pad }} + {{ end }} + {{ with $st.Params.advanced.css_style }} {{ $style = print $style . }} {{ end }}