JSPM

docpad-plugin-emailobfuscator

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q26934F

DocPad plugin that adds the ability obfuscate email addresses.

Package Exports

  • docpad-plugin-emailobfuscator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (docpad-plugin-emailobfuscator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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