diff options
author | Andrew Zenk <andrew@andrewzenk.com> | 2020-12-02 05:53:53 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 12:53:53 +0100 |
commit | 4fc918e02cfc7f260d6312248ff9d33e95b27943 (patch) | |
tree | 64621d7e7e447b644c8456503e0648e6e8ed9a0e /tpl | |
parent | 0ad378b09cea90a2a70d7ff06af668abe22475a1 (diff) |
tpl: Add title parameter to YouTube shortcode
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 8 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/shortcodes/youtube.html | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 1bed51420..3af86cb6c 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -531,12 +531,12 @@ if (!doNotTrack) { {{- 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) }} +{{- $class := .Get "class" | default (.Get 1) -}} +{{- $title := .Get "title" | default "YouTube Video" }} <div {{ with $class }}class="{{ . }}"{{ else }}style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"{{ end }}> - <iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}allowfullscreen title="YouTube Video"></iframe> + <iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}allowfullscreen title="{{ $title }}"></iframe> </div> -{{ end -}} -`}, +{{ end -}}`}, {`twitter_cards.html`, `{{- with $.Params.images -}} <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:image" content="{{ index . 0 | absURL }}"/> diff --git a/tpl/tplimpl/embedded/templates/shortcodes/youtube.html b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html index 9e8477659..93fed2326 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/youtube.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/youtube.html @@ -2,8 +2,9 @@ {{- 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) }} +{{- $class := .Get "class" | default (.Get 1) -}} +{{- $title := .Get "title" | default "YouTube Video" }} <div {{ with $class }}class="{{ . }}"{{ else }}style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"{{ end }}> - <iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}allowfullscreen title="YouTube Video"></iframe> + <iframe src="https://{{ $ytHost }}/embed/{{ $id }}{{ with .Get "autoplay" }}{{ if eq . "true" }}?autoplay=1{{ end }}{{ end }}" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}allowfullscreen title="{{ $title }}"></iframe> </div> {{ end -}} |