blog/layouts/shortcodes/obfuscate.html
2023-02-04 01:21:20 -06:00

21 lines
582 B
HTML

{{/* This is fucked */}}
{{- $sliceOriginal := split .Inner "" -}}
{{- $len := len $sliceOriginal -}}
{{- $sliceReversed := slice -}}
{{- range seq $len -}}
{{- $sliceReversed = $sliceReversed | append (index $sliceOriginal (sub $len .)) }}
{{- end -}}
<span class="obfuscate">
{{- range $sliceReversed -}}
{{- if (eq . "@") -}}
<span class="sym-at-sign"></span>
{{- else if (eq . ".") -}}
<span class="sym-dot"></span>
{{- else -}}
<span>{{ . }}</span>
{{- end -}}
&#8205;
{{- end -}}
</span>