blog/layouts/shortcodes/obfuscate.html

22 lines
582 B
HTML
Raw Normal View History

2022-02-08 09:46:56 +00:00
{{/* 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>