aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/_default
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/_markup/render-link.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html
new file mode 100644
index 0000000..7031af3
--- /dev/null
+++ b/layouts/_default/_markup/render-link.html
@@ -0,0 +1,11 @@
+{{- /* A Hugo Markdown render hook to parse links, opening external links in new tabs. */ -}}
+<a
+ href="{{ .Destination | safeURL }}"
+ {{ with .Title }}
+ title="{{ . }}"
+ {{ end }}
+ {{ if strings.HasPrefix .Destination "http" }}
+ target="_blank" rel="noopener"
+ {{ end }}
+ >{{ .Text | safeHTML }}</a
+>