diff options
author | it-gro <13005925+it-gro@users.noreply.github.com> | 2021-09-04 16:01:26 +0300 |
---|---|---|
committer | it-gro <13005925+it-gro@users.noreply.github.com> | 2021-09-04 16:01:26 +0300 |
commit | 9c479a4ef1f8aab7170ac8328d095fd5a2ef853d (patch) | |
tree | accfef054a074f141d318b6198d4c68f4ca9bf37 /layouts | |
parent | 144d7ac42221c479e88de1d7672984e591dd64f2 (diff) |
wip
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/w3-col-youtube-playlist.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/layouts/shortcodes/w3-col-youtube-playlist.html b/layouts/shortcodes/w3-col-youtube-playlist.html new file mode 100644 index 0000000..0af2f79 --- /dev/null +++ b/layouts/shortcodes/w3-col-youtube-playlist.html @@ -0,0 +1,26 @@ +{{- range $index, $ytList := (seq 0 (sub (len .Params) 1) ) }} + {{- if eq (mod $index 3) 0 }} +<div class="w3-row-padding "> + {{- end }} + <div class="w3-col m4 "> + <div class="w3-card-4 w3-padding-small w3-center w3-theme-l3 "> + {{/* https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/youtube.html */}} + {{- $pc := $.Page.Site.Config.Privacy.YouTube -}} + {{- if not $pc.Disable -}} + {{- $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" -}} + {{- $pl := $.Get $index -}} + <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;" > + <iframe + src="https://{{ $ytHost }}/embed/videoseries?list={{ $pl }}" + style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" + allowfullscreen > + </iframe> + </div> + {{ end -}} + </div> + </div> + {{- if or (eq (mod $index 3) 2) (eq $index (sub (len $.Params) 1 )) }} +</div> +<p> + {{- end }} +{{- end }} |