hugo-geekblog/layouts/_default/_markup/render-link.html

15 lines
404 B
HTML
Raw Normal View History

{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
{{- $code := hasPrefix .Text "<code" -}}
<a
class="gblog-markdown__link{{- if $raw -}}
--raw
{{- else if $code -}}
--code
{{- end }}"
href="{{ .Destination | safeURL }}"
{{- with .Title }}{{ printf "title=\"%s\"" . | safeHTMLAttr }}{{- end }}
>
{{- .Text | safeHTML -}}
</a>
{{- /* Drop trailing newlines */ -}}