SandpointsTheme/layouts/_default/_markup/render-link.html

2 lines
604 B
HTML
Raw Normal View History

2020-11-28 16:28:30 -08:00
{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}<span class="smallcaps">{{- $t -}}</span>{{- end -}}{{- end -}}{{- end -}}{{- else -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}><span class="sup">www</span><i>{{ .Text | safeHTML }}</i></a>{{- end -}}