Dotawo/themes/sandpoints/layouts/_default/_markup/render-link.html

14 lines
626 B
HTML
Raw Normal View History

2020-10-28 22:59:55 +01:00
{{ .Page.Scratch.Add "urls" (slice .Destination) }}
2020-11-26 01:41:48 +01:00
{{ $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 -}}
2020-10-28 22:59:55 +01:00
<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>
2020-11-26 01:41:48 +01:00
{{ end }}