Skip to content

Commit

Permalink
FLUID-5629: added broken link checker to run on build.
Browse files Browse the repository at this point in the history
NOTE: builds will fail if any broken or forbidden links are found.
  • Loading branch information
jobara committed Jul 31, 2024
1 parent 9bbc7a3 commit eb3fa54
Show file tree
Hide file tree
Showing 4 changed files with 496 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
.cache
_site
node_modules
8 changes: 8 additions & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

var githubSlugify = require("github-slugger").slug;
var {exec} = require("child_process");
const brokenLinksPlugin = require("eleventy-plugin-broken-links");

require("./index.js");
var hljs = require("highlight.js");
Expand Down Expand Up @@ -42,6 +43,13 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addTransform("parse", parseTransform);

eleventyConfig.addPlugin(navigationPlugin);
eleventyConfig.addPlugin(brokenLinksPlugin, {
forbidden: "error",
broken: "error",
// Codepen links return 403
// see: https://github.com/bradleyburgess/eleventy-plugin-broken-links/issues/9
excludeUrls: ["https://codepen.io*"]
});

eleventyConfig.addPassthroughCopy({
"node_modules/infusion/dist": "lib/infusion/dist",
Expand Down
Loading

0 comments on commit eb3fa54

Please sign in to comment.