MtF-wiki/layouts/_default/_markup/render-link.html

12 lines
515 B
HTML

{{- if hasPrefix .Destination "https://t.me/" -}}
<a href="{{ .Destination }}">@{{ slicestr .Destination 13 }}</a>
{{- else if hasPrefix .Destination "mailto:" -}}
{{- $text := replace (replace .Text "-" "--") "_" "__" -}}
<a data-email="{{ .Destination | base64Encode }}">
<img class="shields-icon" src="https://img.shields.io/badge/email-{{ $text }}-blue.svg?style=flat-square" />
</a>
{{- else -}}
<a href="{{ .Destination }}"{{ with .Title}} title="{{ . }}"{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- end -}}