2018-05-20 14:00:29 -04:00
|
|
|
{{- $pc := .Page.Site.PrivacyConfig.YouTube -}}
|
|
|
|
{{- if not $pc.Disable -}}
|
2018-05-21 08:02:30 -04:00
|
|
|
{{ $ytHost := cond $pc.PrivacyEnhanced "www.youtube-nocookie.com" "www.youtube.com" }}
|
2018-05-04 11:53:56 -04:00
|
|
|
{{ 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 }}>
|
2018-05-21 08:02:30 -04:00
|
|
|
<iframe src="//{{ $ytHost }}/embed/{{ .Get "id" }}?{{ with .Get "autoplay" }}{{ if eq . "true" }}autoplay=1{{ end }}{{ end }}"
|
2018-05-04 11:53:56 -04:00
|
|
|
{{ 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 }}>
|
2018-05-21 08:02:30 -04:00
|
|
|
<iframe src="//{{ $ytHost }}/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>
|
2018-05-04 11:53:56 -04:00
|
|
|
</div>
|
2018-05-20 14:00:29 -04:00
|
|
|
{{ end }}
|
|
|
|
{{- end -}}
|