aboutsummaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-10-28 16:15:25 +0200
committerOscar Najera <hi@oscarnajera.com>2023-10-28 16:15:25 +0200
commit90967ae85f93ddf02485f4dc1b07789b8ef57b64 (patch)
treef10eb79dc952eeedbfa05f0759fda65bd0d7f8f1 /layouts
parent578d288907f178de8a0be1a631bca6b4f46a9242 (diff)
downloadhugo-minimalist-theme-90967ae85f93ddf02485f4dc1b07789b8ef57b64.tar.gz
hugo-minimalist-theme-90967ae85f93ddf02485f4dc1b07789b8ef57b64.tar.bz2
hugo-minimalist-theme-90967ae85f93ddf02485f4dc1b07789b8ef57b64.zip
External links
Diffstat (limited to 'layouts')
-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
+>