diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 6b24af7..001fb8d 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -100,6 +100,9 @@ withBlogSidebar: true {# Rich reply context with h-cite microformat #} {% include "components/reply-context.njk" %} + {# Footnotes collected from {% footnoteref %} shortcodes in the content #} + {% footnotes %} + {# AI usage disclosure — articles and notes only #} {% if '/articles/' in page.url or '/notes/' in page.url %}
diff --git a/eleventy.config.js b/eleventy.config.js index ca501e6..f46f7ed 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -20,6 +20,7 @@ import { fileURLToPath } from "url"; const esmRequire = createRequire(import.meta.url); const postGraph = esmRequire("@rknightuk/eleventy-plugin-post-graph"); +const pluginFootnotes = esmRequire("eleventy-plugin-footnotes"); const __dirname = dirname(fileURLToPath(import.meta.url)); const siteUrl = process.env.SITE_URL || "https://example.com"; @@ -154,6 +155,10 @@ export default function (eleventyConfig) { // Mermaid diagram support — renders ```mermaid code blocks as diagrams eleventyConfig.addPlugin(pluginMermaid); + // Accessible footnotes — {% footnoteref "id" "note text" %}…{% endfootnoteref %} + // Render collected footnotes with {% footnotes %} in the post layout. + eleventyConfig.addPlugin(pluginFootnotes); + // Post graph — GitHub-style contribution grid for posting frequency eleventyConfig.addPlugin(postGraph, { sort: "desc", diff --git a/package-lock.json b/package-lock.json index 2293cb4..dbc6a14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@zachleat/table-saw": "^1.0.7", "alpinejs": "^3.15.8", "eleventy-plugin-embed-everything": "^1.21.0", + "eleventy-plugin-footnotes": "^0.11.0", "gray-matter": "^4.0.3", "html-minifier-terser": "^7.0.0", "lite-youtube-embed": "^0.3.2", @@ -2317,6 +2318,15 @@ "node": ">=12" } }, + "node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", @@ -2841,6 +2851,15 @@ "url": "https://opencollective.com/11ty" } }, + "node_modules/eleventy-plugin-footnotes": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/eleventy-plugin-footnotes/-/eleventy-plugin-footnotes-0.11.0.tgz", + "integrity": "sha512-NQd6jNPekxIhESIIWPKUv2XXoYYknfDG8KjCdftSMGquncu1u9StVIDPmBinPChl4l68d8qTgmMXyM7kRxwGsg==", + "license": "MIT", + "dependencies": { + "clsx": "^1.1.1" + } + }, "node_modules/eleventy-plugin-vimeo-embed": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/eleventy-plugin-vimeo-embed/-/eleventy-plugin-vimeo-embed-1.4.0.tgz", diff --git a/package.json b/package.json index 9e780ac..7c1baa4 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "@zachleat/table-saw": "^1.0.7", "alpinejs": "^3.15.8", "eleventy-plugin-embed-everything": "^1.21.0", + "eleventy-plugin-footnotes": "^0.11.0", "gray-matter": "^4.0.3", "html-minifier-terser": "^7.0.0", "lite-youtube-embed": "^0.3.2",