Use external link policy everywhere

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

@ -1,8 +1,11 @@
{{ $page := . }} {{ $page := . }}
{{ with $page.Param "paige.comments.muut" }} {{ 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"> <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> <script src="https://cdn.muut.com/1/moot.min.js"></script>
<noscript>{{ i18n "paige_noscript" }}</noscript> <noscript>{{ i18n "paige_noscript" }}</noscript>
</div> </div>

@ -10,7 +10,7 @@
{{ end }} {{ end }}
<p class="mb-0 text-center" id="paige-credit"> <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> </p>
{{ if templates.Exists "partials/paige/footer-last.html" }} {{ if templates.Exists "partials/paige/footer-last.html" }}

@ -36,13 +36,13 @@
{{ $active := or $home $menuprefix $sectionprefix }} {{ $active := or $home $menuprefix $sectionprefix }}
<li class="nav-item {{ if .Children }} dropdown {{ end }}"> <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 }} {{ with .Children }}
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{{ range . }} {{ range . }}
<li> <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> </li>
{{ if .Params.paige.divider_below }} {{ if .Params.paige.divider_below }}

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

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

Loading…
Cancel
Save