big ol toc update
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-09-20 15:07:49 -07:00
parent b4fbeffc41
commit bfa91ea19f
30 changed files with 589 additions and 87 deletions
+14 -7
View File
@@ -1,11 +1,13 @@
import { IdAttributePlugin } from "@11ty/eleventy";
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 toc from "eleventy-plugin-nesting-toc";
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 { execSync } from 'child_process';
@@ -18,7 +20,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?:\/\//);
},
@@ -26,8 +28,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 */
@@ -128,12 +135,12 @@ export default async function(eleventyConfig) {
/* Navigation */
eleventyConfig.addPlugin(eleventyNavigationPlugin);
/* `id` attributes */
eleventyConfig.addPlugin(IdAttributePlugin);
/* Syntax highlighting */
eleventyConfig.addPlugin(syntaxHighlight);
/* Table of contents */
eleventyConfig.addPlugin(toc);
/* Draft handling */
eleventyConfig.addPreprocessor("drafts", "*", (data, content) => {
if (data.draft) {