{{- $url := .Destination | safeURL -}} {{- $parentPath := partial "relative-link.html" . -}} <a href=" {{- if hasPrefix $url "/" -}} {{- $parentPath }}{{ $url | relURL -}} {{- else -}} {{- $url -}} {{- end -}} " {{with .Title}} title="{{.}}"{{end}}>{{.Text | safeHTML}}</a> {{- /* Chomp trailing newline. */ -}}