@sardine/eleventy-plugin-external-links
v1.4.0
Published
An eleventy plugin to enforce safe external links
Downloads
41
Readme
@sardine/eleventy-plugin-external-links
An 11ty plugin to protect you external links.
Features
Adds target="_blank" rel="noreferrer"
to all external links to make them safer.
Original Anchor tags:
<html>
<body>
<a href="https://www.external.com">Hello to the outside!</a>
<a href="/internal/link/">Hello to me!</a>
</body>
</html>
Generated Anchor tags:
<html>
<body>
<a href="https://www.external.com" target="_blank" rel="noreferrer">Hello to the outside!</a>
<a href="/internal/link/">Hello to me!</a>
</body>
</html>
Requirements
Installation
npm install --save-dev @sardine/eleventy-plugin-external-links
How to use it
const safeLinks = require('@sardine/eleventy-plugin-external-links');
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(safeLinks);
};