remove target=blank etc

This commit is contained in:
2026-09-12 10:48:36 -07:00
parent c517bb8d69
commit 07bb31111f
80 changed files with 389 additions and 366 deletions
+16 -1
View File
@@ -3,10 +3,13 @@ import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
import { attrs } from "@mdit/plugin-attrs";
import { chunk } from "lodash-es";
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
import path from "node:path";
import { execSync } from 'child_process';
import { chunk } from "lodash-es";
import pluginFilters from "./_config/filters.js";
@@ -14,6 +17,18 @@ export default async function(eleventyConfig) {
/* Markdown HTML attribute parsing */
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
/* Markdown apply target="_blank" to all external links */
const milaOptions = {
matcher(href) {
return href.match(/^https?:\/\//);
},
attrs: {
target: "_blank",
rel: "external",
},
};
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, milaOptions));
/* Bundles */
/* CSS */
eleventyConfig.addBundle("css", {