diff options
author | Jake Wiesler <jakewiesler@gmail.com> | 2020-10-18 18:22:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-18 18:22:53 +0300 |
commit | ac5c699d85ce398fb42913a5212dbeb8971e157e (patch) | |
tree | b450c08effecc4b41322cd465b400f1239a0629f | |
parent | f76ad38a6566755ce71d9bbde38bdc5af9e6f99b (diff) | |
parent | 2a4154930948331229ecb0941132dfc701340dca (diff) |
Merge pull request #121 from SanchithHegde/hooks-new-tab
layouts: Add markdown render hook to open links in new tab
-rw-r--r-- | layouts/_default/_markup/render-link.html | 4 |
1 files changed, 4 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..d445e88 --- /dev/null +++ b/layouts/_default/_markup/render-link.html @@ -0,0 +1,4 @@ +<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}" {{ end }} + {{ if strings.HasPrefix .Destination "mailto" }} target="_blank" {{ end }} + {{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noreferrer noopener" {{ end }} +>{{ .Text | safeHTML }}</a> |