1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-05 01:12:11 +00:00
seirdy.one/layouts/_default/_markup/render-link.html

16 lines
452 B
HTML
Raw Normal View History

{{- $parsedTitle := dict -}}
{{- with .Title -}}
{{- $parsedTitle = partial "functions/parse-title-attribute.html" . -}}
{{- end -}}
<a href="{{ .Destination | safeURL }}"
{{- with $parsedTitle.title }} title="{{ . }}"{{- end -}}
{{- with $parsedTitle.attributes -}}
{{- range $k, $v := . -}}
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
{{- end -}}
{{- end -}}
>{{ .Text | safeHTML }}</a>
{{- /* Strip trailing space. */ -}}