feat: add eleventy-plugin-footnotes for accessible footnotes

Registers the KittyGiraudel footnotes plugin and adds {% footnotes %}
to post.njk below the article content.

Usage in content:
  {% footnoteref "id" "Footnote text here" %}anchor text{% endfootnoteref %}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-23 19:08:01 +01:00
parent 42962fad60
commit 5354b3349d
4 changed files with 28 additions and 0 deletions

View File

@@ -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",