diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html new file mode 100644 index 0000000..8367825 --- /dev/null +++ b/layouts/shortcodes/youtube.html @@ -0,0 +1,19 @@ +{{- $pc := .Page.Site.Config.Privacy.YouTube -}} +{{- if not $pc.Disable -}} +{{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} +{{- $id := .Get "id" | default (.Get 0) -}} +{{- $class := .Get "class" | default (.Get 1) -}} +{{- $params := slice -}} +{{- if eq (.Get "autoplay") "true" -}} + {{- $params = $params | append (querify "autoplay" 1) -}} +{{- end -}} +{{- with (.Get "start") -}} + {{- $params = $params | append (querify "start" (. | int)) -}} +{{- end -}} +{{- with (.Get "end") -}} + {{- $params = $params | append (querify "end" (. | int)) -}} +{{- end }} +
+ +
+{{ end -}}