Skip to content

Commit 58e8e36

Browse files
committed
forcing external doc links to open in a new tab/window
1 parent 327d54e commit 58e8e36

File tree

1 file changed

+11
-1
lines changed
  • documentation/4.0/themes/hugo-theme-relearn-8.3.0/layouts/_default/_markup

1 file changed

+11
-1
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
<!-- rpatrick - make external links open in a new tab/window
12
{{- partial "shortcodes/link.html" (dict
23
"page" .Page
34
"url" .Destination
45
"title" .Title
56
"content" .Text
6-
) }}
7+
) }}
8+
-->
9+
10+
<a href="{{ .Destination | safeURL }}"
11+
{{ with .Title}} title="{{ . }}"{{ end }}
12+
{{ if strings.HasPrefix .Destination "http" }}
13+
target="_blank" rel="noopener noreferrer"
14+
{{ end }}>
15+
{{ .Text | safeHTML }}
16+
</a>

0 commit comments

Comments
 (0)