DocPad
emailobfuscator Plugin forInstall
docpad install emailobfuscator
How it works
This plugin adds a function checkAndObfuscate(emailAddress) to templateData
. This function checks whether the
provided emailAddress is valid and returns an obfuscated version (using munge). If
not valid, throws an error.
For example:
<a href="mailto:<%- @checkAndObfuscate('contact@me.com') %>">contact me</a>
<a href="mailto:<%- @checkAndObfuscate('mail@me.com') %>">@checkAndObfuscate('mail@me.com')</a>
You can also provide a list of named email addresses in the plugin config as follows:
plugins:
emailobfuscator:
emailAddresses:
general: "general@address.com"
support: "support@address.com"
And then use them like this:
<a href="mailto:<%- @emailAddresses.general %>">contact us</a>
<a href="mailto:<%- @emailAddresses.support %>">get support</a>
History
You can discover the history inside the History.md
file
License
Licensed under the incredibly permissive MIT License
Copyright © YEAR+ NAME