Files
documentation/layouts/_markup/render-link.html
T
2026-10-20 09:41:46 -06:00

8 lines
361 B
HTML

{{- $u := urls.Parse .Destination -}}
{{- $href := .Destination -}}
{{- if and (not $u.IsAbs) (strings.HasPrefix .Destination "/") -}}
{{- $href = relURL (strings.TrimPrefix "/" .Destination) -}}
{{- end -}}
<a href="{{ $href | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $u.IsAbs }} rel="noopener"{{ end }}>{{ .Text }}</a>
{{- /* chomp */ -}}