docpad-plugin-emailobfuscator
v2.0.0
Published
DocPad plugin that adds the ability obfuscate email addresses.
Readme
emailobfuscator Plugin for DocPad
Install
docpad install emailobfuscatorHow 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('[email protected]') %>">contact me</a>
<a href="mailto:<%- @checkAndObfuscate('[email protected]') %>">@checkAndObfuscate('[email protected]')</a>You can also provide a list of named email addresses in the plugin config as follows:
plugins:
emailobfuscator:
emailAddresses:
general: "[email protected]"
support: "[email protected]"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


