Don't try to add templates from section for _index.md

Causes a strange segfault otherwise
This commit is contained in:
dzello 2018-07-23 01:36:26 +02:00
parent bf4801d37b
commit db6d875a3f
1 changed files with 6 additions and 2 deletions

View File

@ -19,8 +19,12 @@
<section data-noprocess data-shortcode-slide
{{- $template := $params.Get "template" -}}
{{- if $template -}}
{{- $templateParams := slice $.Site.Params.reveal_hugo.templates ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates $.Page.Params.reveal_hugo.templates -}}
{{- range $templateParams -}}
{{- $scratch.Add "templateParams" (slice $.Site.Params.reveal_hugo.templates) -}}
{{- if ne $.Page.File.LogicalName "_index.md" -}}
{{- $scratch.Add "templateParams" (slice ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates) -}}
{{- end -}}
{{- $scratch.Add "templateParams" (slice $.Page.Params.reveal_hugo.templates) -}}
{{- range ($scratch.Get "templateParams") -}}
{{- if (ne . nil) -}}
{{- range $key, $value := (index . $template) -}}
{{- $scratch.SetInMap "template" $key $value | safeHTMLAttr -}}