aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default/_markup
diff options
context:
space:
mode:
authorNicholas Johnson <mail@nicholasjohnson.ch>2024-11-08 00:00:00 +0000
committerNicholas Johnson <mail@nicholasjohnson.ch>2024-11-08 00:00:00 +0000
commita0ccea9bef11f02bad2cfc3f975818f4977d1f4364e94a8366d98abb74614579 (patch)
tree31dcb8aebb2c04b52305a6f3ee801a3e8afcd37a5da6ebbe66ea9e7b8f917dd9 /layouts/_default/_markup
parentafb2d1be3159702479487ad6b719ac4d974c149d92903c2968692c25db28df8a (diff)
downloadhugo-theme-journal-a0ccea9bef11f02bad2cfc3f975818f4977d1f4364e94a8366d98abb74614579.tar.gz
hugo-theme-journal-a0ccea9bef11f02bad2cfc3f975818f4977d1f4364e94a8366d98abb74614579.zip
Add "external" to rel attribute for external links
Diffstat (limited to 'layouts/_default/_markup')
-rw-r--r--layouts/_default/_markup/render-link.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html
index def4151..6cadaec 100644
--- a/layouts/_default/_markup/render-link.html
+++ b/layouts/_default/_markup/render-link.html
@@ -1,2 +1,2 @@
{{ $emoji := cond (and (not (.Page.Params.makerefs | default true)) (.Page.Params.showlinkemoji | default true)) (emojify ":link: ") "" -}}
-{{ $emoji }}<a class="link" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }} rel="noreferrer">{{ .Text }}</a> \ No newline at end of file
+{{ $emoji }}<a class="link" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }} rel="{{ if (urls.Parse .Destination).IsAbs }}external {{ end }}noreferrer">{{ .Text }}</a> \ No newline at end of file