From 919bc9210a69c801c7304c0b529df93d1dca27aa Mon Sep 17 00:00:00 2001 From: Nic Raboy Date: Fri, 11 Aug 2017 15:36:40 -0700 Subject: [PATCH] Add an iFrame title to the YouTube shortcode To accommodate modern web accessibility as outlined here https://dequeuniversity.com/tips/provide-iframe-titles --- hugolib/embedded_shortcodes_test.go | 6 +++--- tpl/tplimpl/template_embedded.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hugolib/embedded_shortcodes_test.go b/hugolib/embedded_shortcodes_test.go index 6f47f98c3..1c861dc90 100644 --- a/hugolib/embedded_shortcodes_test.go +++ b/hugolib/embedded_shortcodes_test.go @@ -202,17 +202,17 @@ func TestShortcodeYoutube(t *testing.T) { }{ { `{{< youtube w7Ft2ymGmfc >}}`, - "(?s)\n
.*?.*?
\n", + "(?s)\n
.*?.*?
\n", }, // set class { `{{< youtube w7Ft2ymGmfc video>}}`, - "(?s)\n
.*?.*?
\n", + "(?s)\n
.*?.*?
\n", }, // set class and autoplay (using named params) { `{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`, - "(?s)\n
.*?.*?
", + "(?s)\n
.*?.*?
", }, } { var ( diff --git a/tpl/tplimpl/template_embedded.go b/tpl/tplimpl/template_embedded.go index 14f9f138c..bea0e610b 100644 --- a/tpl/tplimpl/template_embedded.go +++ b/tpl/tplimpl/template_embedded.go @@ -39,11 +39,11 @@ func (t *templateHandler) embedShortcodes() { t.addInternalShortcode("speakerdeck.html", "") t.addInternalShortcode("youtube.html", `{{ if .IsNamedParams }}
- +
{{ else }}
- +
{{ end }}`) t.addInternalShortcode("vimeo.html", `{{ if .IsNamedParams }}
@@ -139,7 +139,7 @@ func (t *templateHandler) embedTemplates() { {{ $right := sub .TotalPages .PageNumber }} {{ $showNumber := or (le .PageNumber 3) (eq $right 0) }} {{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 2)) (lt .PageNumber (add $pag.PageNumber 2))) }} - {{ if $showNumber }} + {{ if $showNumber }} {{ $.Scratch.Set "__paginator.ellipsed" false }} {{ $.Scratch.Set "__paginator.shouldEllipse" false }} {{ else }}