{{/* https://github.com/martignoni/hugo-cloak-email */}} {{/* Get address, protocol and other parameters */}} {{- $address := .Get "address" | default (.Get 0) -}} {{- $protocol := .Get "protocol" | default "mailto" -}} {{- $class := .Get "class" -}} {{- $displaytext := .Get "display" -}} {{- $parts := split $address "@" -}} {{- $user := (index $parts 0) -}} {{- $domain := (index $parts 1) | default "" -}} {{- $query := .Get "query" | default "" -}} {{/* Compute md5 fingerprint */}} {{- $fingerprint := md5 (print (.Get "address") $protocol (index (seq 999 | shuffle) 0)) | truncate 8 "" -}} {{/* Set via CSS what is displayed when Javascript is disabled. Query is never displayed */}} {{/* Alter display with Javascript by changing DOM */}} {{/* The end */}}