From cc282afdb721dc600fda22e31c6c192f3e851f9d Mon Sep 17 00:00:00 2001 From: dzello Date: Thu, 8 Nov 2018 23:50:21 +0000 Subject: [PATCH] Improve handling of templates, fix issue with Hugo 0.5.0 Removes wrapping the template maps in an extra slice --- layouts/shortcodes/slide.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/slide.html b/layouts/shortcodes/slide.html index effa9fa..05aca5e 100644 --- a/layouts/shortcodes/slide.html +++ b/layouts/shortcodes/slide.html @@ -16,12 +16,19 @@ {{- $noOutput := slice "content" "template" -}} {{- $template := $params.Get "template" -}} {{- if $template -}} - {{- $scratch.Add "templateParams" (slice $.Site.Params.reveal_hugo.templates) -}} + {{- $scratch.Add "templateParams" slice -}} + {{- with $.Site.Params.reveal_hugo.templates -}} + {{- $scratch.Add "templateParams" . -}} + {{- end -}} {{- if ne $.Page.File.LogicalName "_index.md" -}} - {{- $scratch.Add "templateParams" (slice ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates) -}} + {{- $scratch.Add "templateParams" ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates -}} + {{- end -}} + {{- with $.Page.Params.reveal_hugo.templates -}} + {{- $scratch.Add "templateParams" . -}} {{- end -}} {{- $scratch.Add "templateParams" (slice $.Page.Params.reveal_hugo.templates) -}} - {{- range ($scratch.Get "templateParams") -}} + {{- $templateParams := $scratch.Get "templateParams" }} + {{- range $templateParams -}} {{- if (ne . nil) -}} {{- range $key, $value := (index . $template) -}} {{- $scratch.SetInMap "template" $key $value | safeHTMLAttr -}}