Copy the youtube shortcode and put it in a figure
This commit is contained in:
parent
9008f16203
commit
8a6ec79adf
1 changed files with 12 additions and 0 deletions
12
layouts/shortcodes/youtube_figure.html
Normal file
12
layouts/shortcodes/youtube_figure.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{{- $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) -}}
|
||||
{{- $title := .Get "title" | default "YouTube Video" }}
|
||||
<figure>
|
||||
<div class="youtube">
|
||||
<iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" allowfullscreen frameborder=0 title="{{ $title }}"></iframe>
|
||||
</div>
|
||||
</figure>
|
||||
{{ end -}}
|
Loading…
Add table
Add a link
Reference in a new issue