diff options
author | tdro <tdro@noreply.example.com> | 2023-01-22 02:42:39 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-01-22 02:42:39 -0500 |
commit | 6c889c658ed71bdc18e5b767053530618dcf1759 (patch) | |
tree | 19d00ab286dd3b73aa7b0b03e5ca1aecee45f3ef /themes/default/layouts/shortcodes/youtube.html | |
parent | 52a3cc202f4f58ee9326924b3a0ecbc29af083b1 (diff) | |
download | canory-6c889c658ed71bdc18e5b767053530618dcf1759.tar.gz canory-6c889c658ed71bdc18e5b767053530618dcf1759.tar.bz2 canory-6c889c658ed71bdc18e5b767053530618dcf1759.zip |
themes/default/layouts: Tighten up the markup
Might be able to get free computation..
Diffstat (limited to 'themes/default/layouts/shortcodes/youtube.html')
-rw-r--r-- | themes/default/layouts/shortcodes/youtube.html | 13 |
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 }} |