uci-hugo-doc/layouts/_default/_markup/render-link.html

15 lines
371 B
HTML
Raw Normal View History

2022-06-11 08:46:13 -07:00
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
{{- $code := hasPrefix .Text "<code" -}}
<a
class="gdoc-markdown__link{{ if $raw -}}
--raw
{{- else if $code -}}
--code
{{- end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
>
{{- .Text | safeHTML -}}
</a>
{{- /* Drop trailing newlines */ -}}