themen-hugo-35c3-reveal/layouts/shortcodes/slide.html

24 lines
1022 B
HTML
Raw Normal View History

{{- .Scratch.Set "slides" slice -}}
{{- if len .Inner -}}
{{- .Scratch.Add "slides" .Inner -}}
{{- end -}}
{{- $content := .Get "content" -}}
{{- if $content -}}
{{- $lookup := split $content "." }}
{{- $html := index .Page.Site.Data (index $lookup 0) (index $lookup 1) | markdownify -}}
{{- $slides := split $html "<hr />" -}}
{{- $scratch := .Scratch -}}
{{- range $slides -}}
{{- $scratch.Add "slides" . -}}
{{- end -}}
{{- end -}}
{{- $attributes := slice "background-color" "background-image" "background-size" "background-position" "background-repeat" "transition" "transition-speed" "background-iframe" "background-interactive" "background-video" "background-video-loop" "background-video-muted" -}}
{{- $params := . -}}
{{- range .Scratch.Get "slides" }}
<section data-noprocess data-shortcode-slide
{{- range $attribute := $attributes -}}
{{- with $params.Get $attribute }} data-{{ $attribute | safeHTMLAttr }}="{{ . }}"{{ end -}}
{{- end -}}>
{{ . | safeHTML }}
</section>
{{- end -}}