mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
Use noopener for external URLs that open in new tabs (Close #286)
This commit is contained in:
parent
2605164743
commit
466632ac4d
5 changed files with 12 additions and 11 deletions
|
@ -4,8 +4,9 @@
|
|||
|
||||
{{ with .Site.Copyright }}{{ . | markdownify}} · {{ end }}
|
||||
|
||||
Powered by the <a href="https://github.com/gcushen/hugo-academic" target="_blank">Academic
|
||||
theme</a> for <a href="http://gohugo.io" target="_blank">Hugo</a>.
|
||||
Powered by the
|
||||
<a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
|
||||
<a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a>.
|
||||
|
||||
<span class="pull-right" aria-hidden="true">
|
||||
<a href="#" id="back_to_top">
|
||||
|
|
|
@ -4,28 +4,28 @@
|
|||
<li>
|
||||
<a class="twitter"
|
||||
href="https://twitter.com/intent/tweet?text={{ .Title | html }}&url={{ .Permalink | html }}"
|
||||
target="_blank">
|
||||
target="_blank" rel="noopener">
|
||||
<i class="fa fa-twitter"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="facebook"
|
||||
href="https://www.facebook.com/sharer.php?u={{ .Permalink | html }}"
|
||||
target="_blank">
|
||||
target="_blank" rel="noopener">
|
||||
<i class="fa fa-facebook"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="linkedin"
|
||||
href="https://www.linkedin.com/shareArticle?mini=true&url={{ .Permalink | html }}&title={{ .Title | html }}"
|
||||
target="_blank">
|
||||
target="_blank" rel="noopener">
|
||||
<i class="fa fa-linkedin"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="weibo"
|
||||
href="http://service.weibo.com/share/share.php?url={{ .Permalink | html }}&title={{ .Title | html }}"
|
||||
target="_blank">
|
||||
target="_blank" rel="noopener">
|
||||
<i class="fa fa-weibo"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{{/* Support legacy `organization` option. */}}
|
||||
{{ if $.Site.Params.organization }}
|
||||
<h3 itemprop="worksFor" itemscope itemtype="http://schema.org/Organization">
|
||||
{{ with $.Site.Params.organization_url }}<a href="{{ . }}" target="_blank" itemprop="url">{{ end }}
|
||||
{{ with $.Site.Params.organization_url }}<a href="{{ . }}" target="_blank" itemprop="url" rel="noopener">{{ end }}
|
||||
<span itemprop="name">{{ $.Site.Params.organization }}</span>
|
||||
{{ if $.Site.Params.organization_url }}</a>{{ end }}
|
||||
</h3>
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
{{ range $.Site.Params.organizations }}
|
||||
<h3 itemprop="worksFor" itemscope itemtype="http://schema.org/Organization">
|
||||
{{ with .url }}<a href="{{ . }}" target="_blank" itemprop="url">{{ end }}
|
||||
{{ with .url }}<a href="{{ . }}" target="_blank" itemprop="url" rel="noopener">{{ end }}
|
||||
<span itemprop="name">{{ .name }}</span>
|
||||
{{ if .url }}</a>{{ end }}
|
||||
</h3>
|
||||
|
@ -42,7 +42,7 @@
|
|||
{{ range $.Site.Params.social }}
|
||||
{{ $pack := or .icon_pack "fa" }}
|
||||
<li>
|
||||
<a itemprop="sameAs" href="{{ .link | safeURL }}" target="_blank">
|
||||
<a itemprop="sameAs" href="{{ .link | safeURL }}" target="_blank" rel="noopener">
|
||||
<i class="{{ $pack }} {{ $pack }}-{{ .icon }} big-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
{{ if .Content }}
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ else }}
|
||||
{{ with .Params.external_link }}<a href="{{ . }}" target="_blank">{{ end }}
|
||||
{{ with .Params.external_link }}<a href="{{ . }}" target="_blank" rel="noopener">{{ end }}
|
||||
{{ end }}
|
||||
{{ .Title }}
|
||||
{{ if .Content }}</a>{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
|
||||
{{ with .Params.external_link }}
|
||||
<a class="btn btn-primary btn-outline" href="{{ . }}" target="_blank">{{ i18n "open_project_site" }}</a>
|
||||
<a class="btn btn-primary btn-outline" href="{{ . }}" target="_blank" rel="noopener">{{ i18n "open_project_site" }}</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="article-style" itemprop="articleBody">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue