markdown-it-anchor
continuous-integration/drone/push Build is passing

This commit is contained in:
inherentlee committed 2026-09-22 18:16:25 -07:00
1 parent 66aba72fcc
commit 679b3b291e
3 files changed
+26 -6

No files matched your search

+12 -4
View File
@@ -1,7 +1,10 @@
import { attrs } from "@mdit/plugin-attrs";
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import { attrs } from "@mdit/plugin-attrs";
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
import markdownitIdAttributes from "markdown-it-anchor";
import path from "node:path";
import pluginFilters from "./_config/filters.js";
@@ -11,7 +14,7 @@ export default async function (eleventyConfig) {
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
/* Markdown apply target="_blank" to all external links */
const milaOptions = {
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, {
matcher(href) {
return href.match(/^https?:\/\//);
},
@@ -19,8 +22,13 @@ export default async function (eleventyConfig) {
target: "_blank",
rel: "external",
},
};
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, milaOptions));
}));
/* Markdown apply ID attributes to headers */
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitIdAttributes, {
level: [2, 3, 4],
tabIndex: false,
}));
/* Bundles */
/* CSS */
+13 -2
View File
@@ -1,11 +1,10 @@
{
"name": "siblinghood-11ty",
"name": "siblinghood",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "siblinghood-11ty",
"version": "1.0.0",
"license": "AGPL-3.0-only",
"devDependencies": {
@@ -14,6 +13,7 @@
"@11ty/eleventy-navigation": "^1.0.5",
"@mdit/plugin-attrs": "^0.25.1",
"luxon": "^3.7.2",
"markdown-it-anchor": "^10.0.0",
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
}
},
@@ -1814,6 +1814,17 @@
"markdown-it": "bin/markdown-it.mjs"
}
},
"node_modules/markdown-it-anchor": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-10.0.0.tgz",
"integrity": "sha512-Q8g7Z6OBdH3eXF0lujFqukIxUvgCDZcjzCrJxmD6QiEzU1HWR9fVN+Bf6gxmM+0yrPFs+jUw8gNjLmUQqt6Eew==",
"dev": true,
"license": "Unlicense",
"peerDependencies": {
"@types/markdown-it": "*",
"markdown-it": "*"
}
},
"node_modules/markdown-it-link-attributes": {
"version": "4.0.1",
"resolved": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main",
+1
View File
@@ -15,6 +15,7 @@
"@11ty/eleventy-navigation": "^1.0.5",
"@mdit/plugin-attrs": "^0.25.1",
"luxon": "^3.7.2",
"markdown-it-anchor": "^10.0.0",
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
}
}