2022-02-03 22:17:35 +08:00
|
|
|
{{- if hasPrefix .Destination "mailto:" -}}
|
2021-12-24 17:39:54 +08:00
|
|
|
{{- $text := replace (replace .Text "-" "--") "_" "__" -}}
|
2022-08-08 20:31:28 +08:00
|
|
|
<a class="shields" data-email="{{ .Destination | base64Encode }}">
|
|
|
|
<img src="https://img.shields.io/badge/email-{{ $text }}-blue.svg?style=flat-square" />
|
2022-02-02 07:33:57 +08:00
|
|
|
</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 }}>
|
2022-02-02 11:05:31 +08:00
|
|
|
{{- .Text | replaceRE "^https?://(www.?)?" "" | safeHTML -}}
|
2021-12-24 16:30:09 +08:00
|
|
|
</a>
|
|
|
|
{{- end -}}
|