@achilleus/obfuscate
v1.0.4
Published
A plugin for obfuscating strings in 11ty
Downloads
8
Maintainers
Readme
obfuscatestring
11ty plugin for obfuscating strings
This plugins enables the obfuscating of strings. I mainly use it to prevent harvesting.
Install
$ npm install @achilleus/obfuscatestringConfiguration
In the upper section of your configuration file, usually .eleventy.js, add the following
const obfuscate = require("@achilleus/obfuscate");Within the module.exports functionality, add
eleventyConfig.addPlugin(obfuscate);Usage
In your templates, you now can add the filter to the output:
{{ '[email protected]' | obfuscate | safe }}In the generated file this will be outputted as
foo@bar.orgHowever, the visitor of your site will see
[email protected]The Nunjucks safe filter prevents the output from being escaped. See https://www.11ty.dev/docs/layouts/
Buy me a coffee
If you like this plugin, you can Buy me a coffee.
Credits
Inspiration was taken from the example at https://coderwall.com/p/jpd4zq/simple-method-to-obfuscate-strings-in-javascript by David Long
