aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/youtube.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/shortcodes/youtube.html')
-rw-r--r--themes/default/layouts/shortcodes/youtube.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/themes/default/layouts/shortcodes/youtube.html b/themes/default/layouts/shortcodes/youtube.html
index 99612ed..9ec1cfb 100644
--- a/themes/default/layouts/shortcodes/youtube.html
+++ b/themes/default/layouts/shortcodes/youtube.html
@@ -1,10 +1,12 @@
-{{- $url := "www.youtube-nocookie.com" -}}
{{- $id := default "aqz-KE-bpKQ" (.Get "id" | default (.Get 0)) -}}
{{- $title := default "YouTube Video" (.Get "title" | default (.Get 1)) -}}
{{- $start := default "" (.Get "start" | default (.Get 2)) -}}
{{- $end := default "" (.Get "end" | default (.Get 3)) -}}
{{- $muted := default "" (.Get "muted" | default (.Get 4)) -}}
+{{- $url := "www.youtube-nocookie.com" -}}
+{{- $controls := "?controls=1" -}}
+
{{- if (and $start $end) -}}
{{ $start = print "&start=" $start }}
{{ $end = print "&end=" $end }}
@@ -15,11 +17,14 @@
{{- end -}}
<youtube-video>
- <iframe loading="lazy"
+ <iframe
+ allowfullscreen=""
height="300"
+ loading="lazy"
+ title="{{ $title }}"
sandbox="allow-scripts allow-same-origin"
- src="https://{{ $url }}/embed/{{ $id }}{{ "?controls=1" }}{{ $start }}{{ $end }}{{ $muted }}"
- allowfullscreen title="{{ $title }}">
+ src="https://{{ $url }}/embed/{{ $id }}{{ $controls }}{{ $start }}{{ $end }}{{ $muted }}"
+ >
</iframe>
<footer>
{{ $title | markdownify }}