aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/tplimpl/embedded/templates/shortcodes/youtube.html')
-rwxr-xr-xtpl/tplimpl/embedded/templates/shortcodes/youtube.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/tpl/tplimpl/embedded/templates/shortcodes/youtube.html b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
new file mode 100755
index 000000000..f128889ae
--- /dev/null
+++ b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html
@@ -0,0 +1,9 @@
+{{ if .IsNamedParams }}
+<div {{ if .Get "class" }}class="{{ .Get "class" }}"{{ else }}style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;"{{ end }}>
+ <iframe src="//www.youtube.com/embed/{{ .Get "id" }}?{{ with .Get "autoplay" }}{{ if eq . "true" }}autoplay=1{{ end }}{{ end }}"
+ {{ if not (.Get "class") }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" {{ end }}allowfullscreen frameborder="0" title="YouTube Video"></iframe>
+</div>{{ else }}
+<div {{ if len .Params | eq 2 }}class="{{ .Get 1 }}"{{ else }}style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;"{{ end }}>
+ <iframe src="//www.youtube.com/embed/{{ .Get 0 }}" {{ if len .Params | eq 1 }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" {{ end }}allowfullscreen frameborder="0" title="YouTube Video"></iframe>
+ </div>
+{{ end }} \ No newline at end of file