Skip to content

Commit 230fad5

Browse files
author
Tony Wasserka
committed
Mark external links
1 parent c87db7b commit 230fad5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layouts/_default/_markup/render-link.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{{- if (not (or (strings.HasPrefix .Destination "http") (strings.HasPrefix .Destination "#"))) }}
1+
{{ $isExternal := (strings.HasPrefix .Destination "http") }}
2+
{{- if (not (or $isExternal (strings.HasPrefix .Destination "#"))) }}
23
{{ $style := "" }}
34
{{ with $.PageInner.GetPage (index (strings.Split .Destination "#") 0) }}
45
{{ else }}
@@ -16,6 +17,7 @@
1617
{{- with .Title }} title="{{ . }}"{{ end -}}
1718
{{- if (strings.HasPrefix .Destination "http") }} target="_blank" rel="external"{{ end -}}
1819
>
20+
{{ if $isExternal }}🔗 {{ end }}
1921
{{- with .Text }}{{ . }}{{ end -}}
2022
</a>
2123
{{ end -}}

0 commit comments

Comments
 (0)