Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cloak_email.html « partials « layouts - github.com/themefisher/airspace-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cd631de133c97ac47467bf1d83ebc6b89115ee78 (plain)
1
2
3
4
5
6
7
8
9
10
{{/* Cloak an e-mail address (first argument) */ -}}
{{- $address_parts := split . "@" -}}
{{- if (eq (len $address_parts) 2) -}}
{{- $user := index $address_parts 0 -}}
{{- $domain := index $address_parts 1 -}}
<span class="cloaked-e-mail" data-user="{{ range $index := seq (sub (len $user) 1) 0 }}{{ substr $user $index 1 }}{{ end }}" data-domain="{{ range $index := seq (sub (len $domain) 1) 0 }}{{ substr $domain $index 1 }}{{ end }}"></span>
{{- else -}}
<span>INVALID E-MAIL ADDRESS</span>
{{- end -}}
{{- /* Dummy comment to strip trailing newline */ -}}