summaryrefslogtreecommitdiff
path: root/layouts/_default/_markup/render-link.html
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
commit9057f651fb508edf0e0488df590ed119d08a28b5b8860c7eedd1190eb6e5f571 (patch)
treeea976f6e5f4339bdf376de832f73bd00612f0cc6320d2031ce92cbbcfd06ce0b /layouts/_default/_markup/render-link.html
parent9b5a1119d7c0b381be13a329e58388f76637d456d4b0de4c54e2ce2bafaf74a7 (diff)
downloadhugo-theme-journal-9057f651fb508edf0e0488df590ed119d08a28b5b8860c7eedd1190eb6e5f571.tar.gz
hugo-theme-journal-9057f651fb508edf0e0488df590ed119d08a28b5b8860c7eedd1190eb6e5f571.zip
Change CSS styling for external links
Diffstat (limited to 'layouts/_default/_markup/render-link.html')
-rw-r--r--layouts/_default/_markup/render-link.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html
index 6cadaec..8fb3c26 100644
--- a/layouts/_default/_markup/render-link.html
+++ b/layouts/_default/_markup/render-link.html
@@ -1,2 +1,3 @@
{{ $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="{{ if (urls.Parse .Destination).IsAbs }}external {{ end }}noreferrer">{{ .Text }}</a> \ No newline at end of file
+{{ $isExternalLink := (urls.Parse .Destination).IsAbs -}}
+{{ $emoji }}<a class="link {{ if $isExternalLink }}link--external{{ else }}link--internal{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }} rel="{{ if $isExternalLink }}external {{ end }}noreferrer">{{ .Text }}</a> \ No newline at end of file