hugo-theme-lowtech/layouts/partials/contact/mail.html

13 lines
478 B
HTML
Raw Normal View History

2021-07-03 16:03:24 +02:00
{{- $protocol := "mailto" -}}
{{- $mail := . -}}
{{- $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>