Document usage of class slide attribute and don't pfx it

This commit is contained in:
dzello
2018-07-23 00:49:48 +02:00
parent 77d38e4f34
commit bf4801d37b
4 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -13,7 +13,7 @@
{{- end -}}
{{- end -}}
{{- $params := . -}}
{{- $noPrefix := slice "id" -}}
{{- $noPrefix := slice "id" "class" -}}
{{- $noOutput := slice "content" "template" -}}
{{- range $scratch.Get "slides" }}
<section data-noprocess data-shortcode-slide
@@ -28,7 +28,8 @@
{{- end -}}
{{- end -}}
{{- range $key, $value := ($scratch.Get "template") }}
data-{{ $key | safeHTMLAttr }}="{{ $value }}"
{{- $attrName := cond (in $noPrefix $key) $key (delimit (slice "data" $key) "-") }}
{{ $attrName | safeHTMLAttr }}="{{ $value }}"
{{- end }}
data-template="{{ $template }}"
{{- end -}}