diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-09-21 11:08:47 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-21 10:08:47 +0200 |
commit | 34dc06b032741abac342d7a2a77510ded9b72ae8 (patch) | |
tree | 5df5fd3f14bd0e0d2a25c9924d1d635f4b2b113d /tpl | |
parent | 2b1814ee580f3149f9fe0a4cf30b754bac9f0c90 (diff) |
tpl: Add `rel="noopener"` for external links
This could be a security and performance issue.
See https://developers.google.com/web/tools/lighthouse/audits/noopener
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 4 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html | 2 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index 525cff64f..0b57077bb 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -380,7 +380,7 @@ if (!doNotTrack) { <div class="card-header"> <a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a> </div> - <a href="{{ $mediaURL }}" target="_blank"><img class="card-img-top img-fluid" src="{{ $item.thumbnail_url }}" width="{{ $item.thumbnail_width }}" height="{{ $item.thumbnail_height }}" alt="Instagram Image"></a> + <a href="{{ $mediaURL }}" rel="noopener" target="_blank"><img class="card-img-top img-fluid" src="{{ $item.thumbnail_url }}" width="{{ $item.thumbnail_width }}" height="{{ $item.thumbnail_height }}" alt="Instagram Image"></a> <div class="card-body"> {{ if not $hideCaption }}<p class="card-text"><a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a> {{ $item.title}}</p>{{ end }} <a href="{{ $item.author_url | safeURL }}" class="card-link">View More on Instagram</a> @@ -486,7 +486,7 @@ if (!doNotTrack) { {{ $secondClass := "s_video_simple" }} <div class="{{ $secondClass }} {{ $class }}"> {{- with $item }} -<a href="{{ .provider_url }}{{ .video_id }}" target="_blank"> +<a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank"> {{ $thumb := .thumbnail_url }} {{ $original := $thumb | replaceRE "(_.*\\.)" "." }} <img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}"> diff --git a/tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html b/tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html index 075fe980f..d816093a6 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/instagram_simple.html @@ -15,7 +15,7 @@ <div class="card-header"> <a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a> </div> - <a href="{{ $mediaURL }}" target="_blank"><img class="card-img-top img-fluid" src="{{ $item.thumbnail_url }}" width="{{ $item.thumbnail_width }}" height="{{ $item.thumbnail_height }}" alt="Instagram Image"></a> + <a href="{{ $mediaURL }}" rel="noopener" target="_blank"><img class="card-img-top img-fluid" src="{{ $item.thumbnail_url }}" width="{{ $item.thumbnail_width }}" height="{{ $item.thumbnail_height }}" alt="Instagram Image"></a> <div class="card-body"> {{ if not $hideCaption }}<p class="card-text"><a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a> {{ $item.title}}</p>{{ end }} <a href="{{ $item.author_url | safeURL }}" class="card-link">View More on Instagram</a> diff --git a/tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html b/tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html index 50699ecd4..9a4fb794d 100644 --- a/tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html +++ b/tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html @@ -10,7 +10,7 @@ {{ $secondClass := "s_video_simple" }} <div class="{{ $secondClass }} {{ $class }}"> {{- with $item }} -<a href="{{ .provider_url }}{{ .video_id }}" target="_blank"> +<a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank"> {{ $thumb := .thumbnail_url }} {{ $original := $thumb | replaceRE "(_.*\\.)" "." }} <img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}"> |