@sardine/eleventy-plugin-external-links
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

@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);
};

License

MIT

/@sardine/eleventy-plugin-external-links/

    Package Sidebar

    Install

    npm i @sardine/eleventy-plugin-external-links

    Weekly Downloads

    34

    Version

    1.4.0

    License

    MIT

    Unpacked Size

    8.67 kB

    Total Files

    7

    Last publish

    Collaborators

    • petinga
    • marabyte