summaryrefslogtreecommitdiff
path: root/layouts/_markup/render-link.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_markup/render-link.html')
-rw-r--r--layouts/_markup/render-link.html3
1 files changed, 3 insertions, 0 deletions
diff --git a/layouts/_markup/render-link.html b/layouts/_markup/render-link.html
new file mode 100644
index 0000000..8fb3c26
--- /dev/null
+++ b/layouts/_markup/render-link.html
@@ -0,0 +1,3 @@
+{{ $emoji := cond (and (not (.Page.Params.makerefs | default true)) (.Page.Params.showlinkemoji | default true)) (emojify ":link: ") "" -}}
+{{ $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