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

13 lines
480 B
HTML

{{- $protocol := "tel" -}}
{{- $tel := . -}}
{{- $telWithProtocol := $tel -}}
{{- if strings.HasPrefix $tel $protocol -}}
{{- $tel = substr $tel 4 -}}
{{- else -}}
{{- $telWithProtocol := print $protocol ":" (replace $tel " " "") -}}
{{- end -}}
<a
class="tel obfuscate"
data-link="{{ range $index := seq (sub (len $telWithProtocol) 1) 0}}{{ substr $telWithProtocol $index 1}}{{ end }}"
>{{ range $index := seq (sub (len $tel) 1) 0}}{{ substr $tel $index 1}}{{ end }}</a>