2018-07-23 00:43:30 +02:00
|
|
|
{{- $scratch := .Scratch -}}
|
|
|
|
{{- $scratch.Set "slides" slice -}}
|
2018-07-22 11:50:06 +02:00
|
|
|
{{- $content := .Get "content" -}}
|
|
|
|
{{- if $content -}}
|
|
|
|
{{- $lookup := split $content "." }}
|
2018-07-22 10:54:47 +02:00
|
|
|
{{- $html := index .Page.Site.Data (index $lookup 0) (index $lookup 1) | markdownify -}}
|
|
|
|
{{- $slides := split $html "<hr />" -}}
|
|
|
|
{{- range $slides -}}
|
|
|
|
{{- $scratch.Add "slides" . -}}
|
|
|
|
{{- end -}}
|
2018-08-03 16:07:12 +02:00
|
|
|
{{- else -}}
|
|
|
|
{{- $scratch.Add "slides" "" -}}
|
2018-07-22 10:54:47 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $params := . -}}
|
2018-07-23 00:49:48 +02:00
|
|
|
{{- $noPrefix := slice "id" "class" -}}
|
2018-07-23 00:43:30 +02:00
|
|
|
{{- $noOutput := slice "content" "template" -}}
|
2018-08-07 18:27:19 +02:00
|
|
|
{{- $template := $params.Get "template" -}}
|
|
|
|
{{- if $template -}}
|
2018-11-09 00:50:21 +01:00
|
|
|
{{- $scratch.Add "templateParams" slice -}}
|
|
|
|
{{- with $.Site.Params.reveal_hugo.templates -}}
|
|
|
|
{{- $scratch.Add "templateParams" . -}}
|
|
|
|
{{- end -}}
|
2018-08-07 18:27:19 +02:00
|
|
|
{{- if ne $.Page.File.LogicalName "_index.md" -}}
|
2018-11-09 00:50:21 +01:00
|
|
|
{{- $scratch.Add "templateParams" ($.Site.GetPage $.Page.Section).Params.reveal_hugo.templates -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- with $.Page.Params.reveal_hugo.templates -}}
|
|
|
|
{{- $scratch.Add "templateParams" . -}}
|
2018-08-07 18:27:19 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- $scratch.Add "templateParams" (slice $.Page.Params.reveal_hugo.templates) -}}
|
2018-11-09 00:50:21 +01:00
|
|
|
{{- $templateParams := $scratch.Get "templateParams" }}
|
|
|
|
{{- range $templateParams -}}
|
2018-08-07 18:27:19 +02:00
|
|
|
{{- if (ne . nil) -}}
|
|
|
|
{{- range $key, $value := (index . $template) -}}
|
|
|
|
{{- $scratch.SetInMap "template" $key $value | safeHTMLAttr -}}
|
2018-07-23 00:43:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2018-08-07 18:27:19 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- range $sindex, $svalue := $scratch.Get "slides" }}
|
|
|
|
<section data-noprocess data-shortcode-slide
|
|
|
|
{{- if $template -}}
|
|
|
|
{{- range $key, $value := ($scratch.Get "template") }}
|
|
|
|
{{- $attrName := cond (in $noPrefix $key) $key (delimit (slice "data" $key) "-") }}
|
|
|
|
{{ $attrName | safeHTMLAttr }}="{{ $value }}"
|
|
|
|
{{- end }}
|
|
|
|
data-template="{{ $template }}"
|
|
|
|
{{- end -}}
|
2018-07-22 18:25:48 +02:00
|
|
|
{{- range $key, $value := $.Params -}}
|
|
|
|
{{- if not (in $noOutput $key) -}}
|
|
|
|
{{- $attrName := cond (in $noPrefix $key) $key (delimit (slice "data" $key) "-") }}
|
|
|
|
{{ $attrName | safeHTMLAttr }}="{{ $value }}"
|
|
|
|
{{- end -}}
|
2018-07-21 10:53:55 +02:00
|
|
|
{{- end -}}>
|
2018-08-03 16:07:12 +02:00
|
|
|
{{ $svalue | safeHTML }}
|
|
|
|
{{- if ne $sindex (sub (len ($scratch.Get "slides")) 1) -}}
|
2018-07-21 10:53:55 +02:00
|
|
|
</section>
|
2018-08-03 16:07:12 +02:00
|
|
|
{{- end -}}
|
2018-07-22 10:54:47 +02:00
|
|
|
{{- end -}}
|