Remove target="_blank" from links

This commit is contained in:
Jonah Aragon 2022-08-31 20:57:32 -05:00
parent ddaf94cd3d
commit 8c40461fc6
No known key found for this signature in database
6 changed files with 15 additions and 15 deletions

View File

@ -6,7 +6,7 @@
{{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }} {{- $addLink := (and site.Params.cover.linkFullImages (not $.IsHome)) }}
{{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} {{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }}
{{- if $cover -}}{{/* i.e it is present in page bundle */}} {{- if $cover -}}{{/* i.e it is present in page bundle */}}
{{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank" {{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}"
rel="noopener noreferrer">{{ end -}} rel="noopener noreferrer">{{ end -}}
{{- $sizes := (slice "360" "480" "720" "1080" "1500") }} {{- $sizes := (slice "360" "480" "720" "1080" "1500") }}
{{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}}
@ -26,7 +26,7 @@
<img loading="lazy" src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}"> <img loading="lazy" src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }} {{- end }}
{{- else }}{{/* For absolute urls and external links, no img processing here */}} {{- else }}{{/* For absolute urls and external links, no img processing here */}}
{{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank" {{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}"
rel="noopener noreferrer">{{ end -}} rel="noopener noreferrer">{{ end -}}
<img loading="lazy" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}"> <img loading="lazy" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}">
{{- end }} {{- end }}

View File

@ -2,7 +2,7 @@
{{- $fileUrlPath := path.Join .File.Path }} {{- $fileUrlPath := path.Join .File.Path }}
{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }}&nbsp;|&nbsp;{{- end -}} {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }}&nbsp;|&nbsp;{{- end -}}
<a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer" target="_blank"> <a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer">
{{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
</a> </a>
{{- end }} {{- end }}

View File

@ -7,8 +7,8 @@
{{- end }} {{- end }}
<span> <span>
- Powered by - Powered by
<a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> & <a href="https://gohugo.io/" rel="noopener noreferrer">Hugo</a> &
<a href="https://github.com/Wonderfall/hugo-WonderMod/" rel="noopener" target="_blank">WonderMod</a> <a href="https://github.com/Wonderfall/hugo-WonderMod/" rel="noopener">WonderMod</a>
</span> </span>
</footer> </footer>
{{- end }} {{- end }}
@ -23,4 +23,4 @@
{{- partial "extend_footer.html" . }} {{- partial "extend_footer.html" . }}
{{- partial "script.html" . }} {{- partial "script.html" . }}

View File

@ -4,6 +4,6 @@
{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }}&nbsp;|&nbsp;{{- end -}} {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL site.Params.editPost.URL) }}&nbsp;|&nbsp;{{- end -}}
<span> <span>
{{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} {{- (site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}}
&nbsp;<a href="{{ trim .Params.canonicalURL " " }}" title="{{ trim .Params.canonicalURL " " }}" target="_blank" rel="noopener noreferrer">{{ $url.Host }}</a> &nbsp;<a href="{{ trim .Params.canonicalURL " " }}" title="{{ trim .Params.canonicalURL " " }}" rel="noopener noreferrer">{{ $url.Host }}</a>
</span> </span>
{{- end }} {{- end }}

View File

@ -15,7 +15,7 @@
<div class="share-buttons"> <div class="share-buttons">
{{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }} {{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter"
href="https://twitter.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}&amp;hashtags={{- $.Scratch.Get "tags" -}}"> href="https://twitter.com/intent/tweet/?text={{ $title }}&amp;url={{ $pageurl }}&amp;hashtags={{- $.Scratch.Get "tags" -}}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
<path <path
@ -24,7 +24,7 @@
</a> </a>
{{- end }} {{- end }}
{{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on linkedin" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on linkedin"
href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ $pageurl }}&amp;title={{ $title }}&amp;summary={{ $title }}&amp;source={{ $pageurl }}"> href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ $pageurl }}&amp;title={{ $title }}&amp;summary={{ $title }}&amp;source={{ $pageurl }}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
<path <path
@ -33,7 +33,7 @@
</a> </a>
{{- end }} {{- end }}
{{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on reddit" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on reddit"
href="https://reddit.com/submit?url={{ $pageurl }}&title={{ $title }}"> href="https://reddit.com/submit?url={{ $pageurl }}&title={{ $title }}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
<path <path
@ -42,7 +42,7 @@
</a> </a>
{{- end }} {{- end }}
{{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on facebook" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on facebook"
href="https://facebook.com/sharer/sharer.php?u={{ $pageurl }}"> href="https://facebook.com/sharer/sharer.php?u={{ $pageurl }}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
<path <path
@ -51,7 +51,7 @@
</a> </a>
{{- end }} {{- end }}
{{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on whatsapp" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on whatsapp"
href="https://api.whatsapp.com/send?text={{ $title }}%20-%20{{ $pageurl }}"> href="https://api.whatsapp.com/send?text={{ $title }}%20-%20{{ $pageurl }}">
<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor"> <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" height="30px" width="30px" fill="currentColor">
<path <path
@ -60,7 +60,7 @@
</a> </a>
{{- end }} {{- end }}
{{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }}
<a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on telegram" <a rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on telegram"
href="https://telegram.me/share/url?text={{ $title }}&amp;url={{ $pageurl }}"> href="https://telegram.me/share/url?text={{ $title }}&amp;url={{ $pageurl }}">
<svg version="1.1" xml:space="preserve" viewBox="2 2 28 28" height="30px" width="30px" fill="currentColor"> <svg version="1.1" xml:space="preserve" viewBox="2 2 28 28" height="30px" width="30px" fill="currentColor">
<path <path
@ -68,4 +68,4 @@
</svg> </svg>
</a> </a>
{{- end }} {{- end }}
</div> </div>

View File

@ -1,6 +1,6 @@
<div class="social-icons"> <div class="social-icons">
{{- range . }} {{- range . }}
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}"> <a href="{{ trim .url " " }}" rel="noopener noreferrer me" title="{{ (.title | default .name) | title }}">
{{ partial "svg.html" . }} {{ partial "svg.html" . }}
</a> </a>
{{- end }} {{- end }}