Skip to content

Commit e5d552c

Browse files
author
tianheg
committed
when setting target="_blank" no needed rel="noopener"
refer whatwg/html#4330 https://mathiasbynens.github.io/rel-noopener/
1 parent 6e8dfb4 commit e5d552c

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

themes/tianheg/layouts/partials/components/minimal-footer-about.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{- $linkType := (string .Pre) -}}
88
{{- $iconName := (string .Post) -}}
99
{{- $icon := (index $.Site.Data.SVG $iconName) -}}
10-
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
10+
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
1111
{{ end }}
1212
</div>
1313
{{ end }}
@@ -17,7 +17,7 @@
1717
{{- $linkType := (string .Pre) -}}
1818
{{- $iconName := (string .Post) -}}
1919
{{- $icon := (index $.Site.Data.SVG $iconName) -}}
20-
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
20+
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
2121
{{ end }}
2222
</div>
2323
{{ end }}

themes/tianheg/layouts/partials/components/post-copyright.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ul class="post-copyright">
55
<li class="copyright-item author">
66
{{- with $author.website -}}
7-
<span class="copyright-item-text">{{ i18n "copyrightAuthor" }}</span>{{ i18n "colon" }}<a href="{{ . }}" class="p-author h-card" target="_blank" rel="noopener">{{ $author.name }}</a>
7+
<span class="copyright-item-text">{{ i18n "copyrightAuthor" }}</span>{{ i18n "colon" }}<a href="{{ . }}" class="p-author h-card" target="_blank">{{ $author.name }}</a>
88
{{- else -}}
99
<span class="copyright-item-text">{{ i18n "copyrightAuthor" }}</span>{{ i18n "colon" }}<span class="p-author h-card">{{ $author.name }}</span>
1010
{{- end -}}
@@ -14,10 +14,10 @@
1414
{{ $decodedPath := $url.Path }}
1515
{{ $baseURLWithLangFix := (strings.TrimSuffix "/" (print `/` | absLangURL)) }}
1616
{{ $decodedPermalink := (printf `%s%s` $baseURLWithLangFix $decodedPath) }}
17-
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ $.RelPermalink }}" target="_blank" rel="noopener">{{ $decodedPermalink }}</a></li>
17+
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ $.RelPermalink }}" target="_blank">{{ $decodedPermalink }}</a></li>
1818
{{ else }}
1919
{{ with $.Params.link }}
20-
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ . }}" target="_blank" rel="noopener">{{ . }}</a></li>
20+
<li class="copyright-item link"><span class="copyright-item-text">{{ i18n "copyrightLink" }}</span>{{ i18n "colon" }}<a href="{{ . }}" target="_blank">{{ . }}</a></li>
2121
{{ end }}
2222
{{ end }}
2323
{{ with $author.copyright }}

themes/tianheg/layouts/partials/components/post-gitinfo.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{{ if .Site.Params.displayCommitHash }}
1414
<div class="gitinfo-item commit">
1515
{{- with .Site.Params.repoURL -}}
16-
<a href="{{ . }}/commit/{{ $.GitInfo.Hash }}" target="_blank" rel="noopener">
16+
<a href="{{ . }}/commit/{{ $.GitInfo.Hash }}" target="_blank">
1717
{{- partial "utils/icon.html" (dict "$" $ "name" $.Site.Params.gitIcon "class" "git-icon") -}}
1818
{{- $.GitInfo.AbbreviatedHash -}}
1919
</a>
@@ -38,7 +38,7 @@
3838
{{ if .Site.Params.displayFeedback }}
3939
{{ with .Site.Params.repoURL }}
4040
<div class="gitinfo-item feedback">
41-
<a href="{{ . }}/issues" target="_blank" rel="noopener">
41+
<a href="{{ . }}/issues" target="_blank">
4242
{{- partial "utils/icon.html" (dict "$" $ "name" $.Site.Params.feedbackIcon "class" "feedback-icon") -}}
4343
{{- $.Site.Params.feedbackText -}}
4444
</a>
@@ -49,7 +49,7 @@
4949
{{ with .Site.Params.repoEditURL }}
5050
{{ $contentDir := (cond $.Site.IsMultiLingual (printf `/%s/` $.Site.Params.contentDir) "/content/") }}
5151
<div class="gitinfo-item edit">
52-
<a href="{{ . }}{{ $contentDir }}{{ replace $path "\\" "/" }}" target="_blank" rel="noopener">
52+
<a href="{{ . }}{{ $contentDir }}{{ replace $path "\\" "/" }}" target="_blank">
5353
{{- partial "utils/icon.html" (dict "$" $ "name" $.Site.Params.editIcon "class" "edit-icon") -}}
5454
{{- $.Site.Params.editText -}}
5555
</a>

themes/tianheg/layouts/partials/menu.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{{ else }}
3939
<li class="menu-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{ end }}">
4040
{{- $linkType := (string .Pre) -}}
41-
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>
41+
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external"{{ end }}>
4242
{{- $iconName := (string .Post) -}}
4343
{{- partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) -}}
4444
{{- with .Name -}}

themes/tianheg/layouts/partials/pages/home-footage.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>{{ .Site.Params.homeTitle }}</h1>
2626
{{ range $index, $value := . }}
2727
{{- $linkType := (string .Pre) -}}
2828
{{- $iconName := (string .Post) -}}
29-
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external noopener"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
29+
<a href="{{ .URL }}"{{ if eq $linkType "external" }} target="_blank" rel="external"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
3030
{{- if lt $index $length -}}
3131
{{- $.Site.Params.homeLinksDelimiter -}}
3232
{{- end -}}

themes/tianheg/layouts/partials/pages/home-poetry.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
{{ range . }}
1313
{{- $linkType := (string .Pre) -}}
1414
{{- $iconName := (string .Post) -}}
15-
<a href="{{ .URL }}" class="links-item"{{ if eq $linkType "external" }} target="_blank" rel="noopener"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
15+
<a href="{{ .URL }}" class="links-item"{{ if eq $linkType "external" }} target="_blank"{{ end }}>{{ partial "utils/icon.html" (dict "$" $ "name" $iconName "class" .Identifier) }}{{ .Name }}</a>
1616
{{ end }}
1717
</div>
1818
{{ end }}
1919
</main>
20-
{{ partial "footer.html" . }}
20+
{{ partial "footer.html" . }}

0 commit comments

Comments
 (0)