Use external link policy everywhere

master
Will Faught 2 years ago
parent 4d2292df74
commit 0dff8b54ef

@ -1,8 +1,11 @@
{{ $page := . }}
{{ with $page.Param "paige.comments.muut" }}
{{ $href := printf "https://muut.com/i/%s/comments" .account_id }}
{{ $target := partial "paige/target.html" (dict "page" $page "url" $href) }}
<div class="mb-3" id="paige-comments">
<a href="https://muut.com/i/{{ .account_id }}/comments" class="muut" type="dynamic">Comments</a>
<a href="{{ $href }}" class="muut" type="dynamic" {{ with $target }} target="{{ . }}" {{ end }}>Comments</a>
<script src="https://cdn.muut.com/1/moot.min.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript>
</div>

@ -10,7 +10,7 @@
{{ end }}
<p class="mb-0 text-center" id="paige-credit">
<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige">Paige Theme</a>
<a class="link-secondary text-decoration-none" href="https://github.com/willfaught/paige" {{ with partial "paige/target.html" (dict "page" $page "url" "https://github.com/willfaught/paige") }} target="{{ . }}" {{ end }}>Paige Theme</a>
</p>
{{ if templates.Exists "partials/paige/footer-last.html" }}

@ -36,13 +36,13 @@
{{ $active := or $home $menuprefix $sectionprefix }}
<li class="nav-item {{ if .Children }} dropdown {{ end }}">
<a {{ if $active }} aria-current="page" {{ end }} {{ if .Children }} aria-expanded="false" {{ end }} class="{{ if $active }} active {{ end }} {{ if .Params.paige.disabled }} disabled {{ end }} nav-link {{ if .Children }} dropdown-toggle {{ end }}" {{ if .Children }} data-bs-toggle="dropdown" {{ end }} href="{{ if .Children -}} # {{- else -}} {{ .URL | safeURL }} {{- end }}" {{ if .Children }} role="button" {{ end }}>{{ .Name }}</a>
<a {{ if $active }} aria-current="page" {{ end }} {{ if .Children }} aria-expanded="false" {{ end }} class="{{ if $active }} active {{ end }} {{ if .Params.paige.disabled }} disabled {{ end }} nav-link {{ if .Children }} dropdown-toggle {{ end }}" {{ if .Children }} data-bs-toggle="dropdown" {{ end }} href="{{ if .Children -}} # {{- else -}} {{ .URL | safeURL }} {{- end }}" {{ if .Children }} role="button" {{ end }} {{ if not .Children }} {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }} {{ end }}>{{ .Name }}</a>
{{ with .Children }}
<ul class="dropdown-menu">
{{ range . }}
<li>
<a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}">{{ .Name }}</a>
<a class="{{ if .Params.paige.disabled }} disabled {{ end }} dropdown-item" href="{{ .URL | safeURL }}" {{ with partial "paige/target.html" (dict "page" $page "url" .URL) }} target="{{ . }}" {{ end }}>{{ .Name }}</a>
</li>
{{ if .Params.paige.divider_below }}

@ -86,7 +86,7 @@
{{ with $date }}
<p class="mb-0 text-center text-secondary" id="paige-date">
{{ with $commiturl }}
<a class="link-secondary" href="{{ . }}">
<a class="link-secondary" href="{{ . }}" {{ with partial "paige/target.html" (dict "page" $page "url" .) }} target="{{ . }}" {{ end }}>
{{ end }}
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>

@ -118,7 +118,7 @@
{{ with $date }}
<p class="mb-0 paige-date text-center text-secondary">
{{ with $commiturl }}
<a class="link-secondary" href="{{ . }}">
<a class="link-secondary" href="{{ . }}" {{ with partial "paige/target.html" (dict "page" $page "url" .) }} target="{{ . }}" {{ end }}>
{{ end }}
<time datetime="{{ .Format `2006-01-02` }}">{{ time.Format $dateformat . }}</time>

Loading…
Cancel
Save