You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
624 B
HTML

{{ $address := .Get 0 | default (.Get "address") }}
{{ $content := .InnerDeindent | markdownify }}
{{ if not $address }}
{{ errorf "layouts/shortcodes/paige/email.html: no address" }}
{{ end }}
{{ if not $content }}
{{ errorf "layouts/shortcodes/paige/email.html: no content" }}
{{ end }}
<span class="paige-shortcode-email"><a href="" data-a="{{ base64Encode (index (split $address `@`) 0) }}" data-b="{{ base64Encode `@` }}" data-c="{{ base64Encode (index (split $address `@`) 1) }}" onclick="this.href = 'mailto:' + atob(this.dataset.a) + atob(this.dataset.b) + atob(this.dataset.c)">{{ $content }}</a></span>