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

9 lines
458 B
HTML
Raw Normal View History

{{- if hasPrefix .Destination "mailto:" -}}
2021-12-24 17:39:54 +08:00
{{- $text := replace (replace .Text "-" "--") "_" "__" -}}
{{- $icon := resources.GetRemote (printf "https://img.shields.io/badge/email-%s-blue.svg?style=flat-square" $text) -}}
2021-12-25 06:56:39 +08:00
<a data-email="{{ .Destination | base64Encode }}"><img class="shields-icon" src="{{ $icon.Permalink }}" /></a>
{{- else -}}
2021-12-25 06:56:39 +08:00
<a href="{{ .Destination }}"{{ with .Title}} title="{{ . }}"{{ end }}>
2021-12-24 17:39:54 +08:00
{{- .Text | safeHTML -}}
</a>
{{- end -}}