Skip to content

Commit

Permalink
Add broken links checker plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Anneke Sinnema <mail@annekesinnema.nl>
  • Loading branch information
anneke committed Jan 19, 2024
1 parent 36cd8de commit 0cb47a4
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const lodash = require("lodash");
const slugify = require("slugify");
const pluginAddIdToHeadings = require("@orchidjs/eleventy-plugin-ids");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const brokenLinksPlugin = require("eleventy-plugin-broken-links");

/**
* Get all unique key values from a collection
Expand Down Expand Up @@ -84,6 +85,16 @@ module.exports = function (eleventyConfig) {

eleventyConfig.addPlugin(pluginRss);

eleventyConfig.addPlugin(brokenLinksPlugin, {
redirect: "warn",
broken: "warn",
cacheDuration: "1d",
loggingLevel: 2,
excludeUrls: [],
excludeInputs: [],
callback: null,
});

// Rebuild when any of the files are changed, but exclude css because that is
// handled by the asset pipeline.
// This seemed to cause a bug on refreshing liquid files?
Expand Down
160 changes: 154 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"autoprefixer": "^10.4.14",
"cross-env": "^7.0.3",
"cssnano": "^6.0.1",
"eleventy-plugin-broken-links": "^2.0.3",
"fast-glob": "^3.3.1",
"husky": "8.0.3",
"jsdom": "^22.1.0",
Expand Down

0 comments on commit 0cb47a4

Please sign in to comment.