docpad-plugin-emailobfuscator

2.0.0 • Public • Published

emailobfuscator Plugin for DocPad

Build Status NPM version

Install

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

Readme

Keywords

none

Package Sidebar

Install

npm i docpad-plugin-emailobfuscator

Weekly Downloads

2

Version

2.0.0

License

none

Last publish

Collaborators

  • bertvh