2021-07-03 16:03:24 +02:00
|
|
|
{{- $protocol := "mailto" -}}
|
|
|
|
{{- $mail := . -}}
|
2021-10-21 21:47:42 +02:00
|
|
|
{{- $mailWithProtocol := $mail -}}
|
|
|
|
{{- if strings.HasPrefix $mail $protocol -}}
|
|
|
|
{{- $mail = substr $mail 7 -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $mailWithProtocol = print $protocol ":" $mail -}}
|
|
|
|
{{- end -}}
|
2021-07-03 16:03:24 +02:00
|
|
|
<a
|
|
|
|
class="mail obfuscate"
|
|
|
|
data-link="{{ range $index := seq (sub (len $mailWithProtocol) 1) 0}}{{ substr $mailWithProtocol $index 1}}{{ end }}"
|
|
|
|
>{{ range $index := seq (sub (len $mail) 1) 0}}{{ substr $mail $index 1}}{{ end }}</a>
|