2021-12-24 16:30:09 +08:00
|
|
|
{{- 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>
|
2021-12-24 16:30:09 +08:00
|
|
|
{{- 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 -}}
|
2021-12-24 16:30:09 +08:00
|
|
|
</a>
|
|
|
|
{{- end -}}
|