Skip to main content

Project: Eleventy Plugin: Broken Links

An Eleventy plugin to check your build for broken links

Headshot of Bradley Burgess
Bradley Burgess

April 21, 2022

Project preview

Technologies:

  • 11ty
  • Node.js

Project Links:

Project overview

This is an 11ty plugin to check for broken links during a build. It has been tested with @11ty/eleventy versions 1.0.2 (final v. 1 release), 2.x.x (the latest v. 2 release), and 3.0.0.

There are options for customization, but the gist of it is that the plugin will throw an error during build if there is a broken link, and warn if there are redirects.

The plugin runs after the Eleventy build step and checks all output HTML for broken internal and external links

Project story

My current personal site uses Astro, however I have used 11ty quire a bit in the past and am a big fan. A previous iteration of my personal site was built with it.

I was linking to a fair few external sites in some places, and I searched for a plugin that would detect broken links. (There is little on this earth more annoying than broken links, am I right?)

I couldn’t find an existing plugin, so I built one! It has been used in sites built by other developers, one of whom has actually contributed to the project.

You can read more about this project, including installation and usage, in the project README.