2018-07-23 00:43:30 +02:00
|
|
|
{{- $scratch := .Scratch -}}
|
|
|
|
{{- $scratch.Set "slides" slice -}}
|
2018-07-22 11:50:06 +02:00
|
|
|
{{- if len .Inner -}}
|
2018-07-23 00:43:30 +02:00
|
|
|
{{- $scratch.Add "slides" .Inner -}}
|
2018-07-22 10:54:47 +02:00
|
|
|
{{- end -}}
|
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 -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $params := . -}}
|
2018-07-22 18:25:48 +02:00
|
|
|
{{- $noPrefix := slice "id" -}}
|
2018-07-23 00:43:30 +02:00
|
|
|
{{- $noOutput := slice "content" "template" -}}
|
|
|
|
{{- range $scratch.Get "slides" }}
|
2018-07-22 11:50:06 +02:00
|
|
|
<section data-noprocess data-shortcode-slide
|
2018-07-23 00:43:30 +02:00
|
|
|
{{- $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 -}}
|
|
|
|
{{- if (ne . nil) -}}
|
|
|
|
{{- range $key, $value := (index . $template) -}}
|
|
|
|
{{- $scratch.SetInMap "template" $key $value | safeHTMLAttr -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- range $key, $value := ($scratch.Get "template") }}
|
|
|
|
data-{{ $key | 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 -}}>
|
|
|
|
{{ . | safeHTML }}
|
|
|
|
</section>
|
2018-07-22 10:54:47 +02:00
|
|
|
{{- end -}}
|