feat: add custom link renderer for improved URL handling

Introduced a custom link renderer in the default layout to create links with enhanced URL safety and behavior. Links now open in a new tab if they start with "http", and include a title attribute if provided. This ensures better user experience and security.
This commit is contained in:
Kumi 2024-07-23 11:16:05 +02:00
parent f6db3448bd
commit 26f0a266ec
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -0,0 +1 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>