File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ <h1>{{ member.name }}</h1>
1818< p > {{ member.responsibilities | markdownify | remove: '< p > ' | remove: '</ p > '}} </ p >
1919{% endif %}
2020{% if member.email %}
21- < i > email: < {{ member.email }}> </ i >
21+ < i > email: < {{ member.email | mailObfuscate }}> </ i >
2222{% endif %}
2323{% if member.education %}
2424< p > < strong > Education:</ strong > {{ member.education }} </ p >
Original file line number Diff line number Diff line change 1+ require "base64"
2+ require "uri"
3+
4+ module ObfuscateMailAddress
5+ def mailObfuscate ( input )
6+ base64Mail = Base64 . strict_encode64 ( Addressable ::URI . encode ( input ) )
7+
8+ # See http://techblog.tilllate.com/2008/07/20/ten-methods-to-obfuscate-e-mail-addresses-compared/
9+ output = "<a href=\" #\" "
10+ output += "data-contact=\" #{ base64Mail } \" target=\" _blank\" "
11+ output += "onfocus=\" this.href = 'mailto:' + atob(this.dataset.contact)\" >"
12+ output += "<script type=\" text/javascript\" >document.write(atob(\" #{ base64Mail } \" ));</script></a>"
13+ return output
14+ end
15+ end
16+
17+ Liquid ::Template . register_filter ( ObfuscateMailAddress )
You can’t perform that action at this time.
0 commit comments