mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
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
This commit is contained in:
parent
2b1814ee58
commit
34dc06b032
3 changed files with 4 additions and 4 deletions
4
tpl/tplimpl/embedded/templates.autogen.go
generated
4
tpl/tplimpl/embedded/templates.autogen.go
generated
|
@ -380,7 +380,7 @@ if (!doNotTrack) {
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a>
|
<a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a>
|
||||||
</div>
|
</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">
|
<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 }}
|
{{ 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>
|
<a href="{{ $item.author_url | safeURL }}" class="card-link">View More on Instagram</a>
|
||||||
|
@ -486,7 +486,7 @@ if (!doNotTrack) {
|
||||||
{{ $secondClass := "s_video_simple" }}
|
{{ $secondClass := "s_video_simple" }}
|
||||||
<div class="{{ $secondClass }} {{ $class }}">
|
<div class="{{ $secondClass }} {{ $class }}">
|
||||||
{{- with $item }}
|
{{- with $item }}
|
||||||
<a href="{{ .provider_url }}{{ .video_id }}" target="_blank">
|
<a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank">
|
||||||
{{ $thumb := .thumbnail_url }}
|
{{ $thumb := .thumbnail_url }}
|
||||||
{{ $original := $thumb | replaceRE "(_.*\\.)" "." }}
|
{{ $original := $thumb | replaceRE "(_.*\\.)" "." }}
|
||||||
<img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}">
|
<img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a>
|
<a href="{{ $item.author_url | safeURL }}" class="card-link">{{ $item.author_name }}</a>
|
||||||
</div>
|
</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">
|
<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 }}
|
{{ 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>
|
<a href="{{ $item.author_url | safeURL }}" class="card-link">View More on Instagram</a>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
{{ $secondClass := "s_video_simple" }}
|
{{ $secondClass := "s_video_simple" }}
|
||||||
<div class="{{ $secondClass }} {{ $class }}">
|
<div class="{{ $secondClass }} {{ $class }}">
|
||||||
{{- with $item }}
|
{{- with $item }}
|
||||||
<a href="{{ .provider_url }}{{ .video_id }}" target="_blank">
|
<a href="{{ .provider_url }}{{ .video_id }}" rel="noopener" target="_blank">
|
||||||
{{ $thumb := .thumbnail_url }}
|
{{ $thumb := .thumbnail_url }}
|
||||||
{{ $original := $thumb | replaceRE "(_.*\\.)" "." }}
|
{{ $original := $thumb | replaceRE "(_.*\\.)" "." }}
|
||||||
<img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}">
|
<img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}">
|
||||||
|
|
Loading…
Reference in a new issue