diff --git a/eleventy.config.js b/eleventy.config.js index cb8d2e7..fbfce2f 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -2,7 +2,6 @@ import fs from 'node:fs'; import { env } from 'node:process'; import { eleventyImageTransformPlugin } from '@11ty/eleventy-img'; import { feedPlugin } from '@11ty/eleventy-plugin-rss'; -import { IdAttributePlugin } from '@11ty/eleventy'; import eleventyPluginCiu from '@alexcarpenter/eleventy-plugin-caniuse'; import eleventyPluginEmbedEverything from 'eleventy-plugin-embed-everything'; import eleventyPluginLucideIcons from '@grimlink/eleventy-plugin-lucide-icons'; @@ -13,6 +12,7 @@ import eleventyPluginReadingTime from '@myxotod/eleventy-plugin-readingtime'; import eleventyPluginRobotsTxt from 'eleventy-plugin-robotstxt'; import eleventyPluginSyntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight'; import markdownItAbbr from 'markdown-it-abbr'; +import markdownItAnchor from 'markdown-it-anchor'; import markdownItCallouts from 'markdown-it-obsidian-callouts'; import markdownItCollapsible from 'markdown-it-collapsible'; import markdownItFootnote from 'markdown-it-footnote'; @@ -29,7 +29,6 @@ export default async function (eleventyConfig) { eleventyConfig.addCollection('posts', (collection) => collection.getFilteredByGlob('./src/posts/*.md')); - eleventyConfig.addPlugin(IdAttributePlugin); eleventyConfig.addPlugin(eleventyPluginCiu); eleventyConfig.addPlugin(eleventyPluginEmbedEverything); eleventyConfig.addPlugin(eleventyPluginLucideIcons); @@ -91,6 +90,7 @@ export default async function (eleventyConfig) { eleventyConfig.amendLibrary('md', (mdLib) => mdLib .use(markdownItAbbr) + .use(markdownItAnchor) .use(markdownItCollapsible) .use(markdownItCallouts) .use(markdownItFootnote) diff --git a/package-lock.json b/package-lock.json index 34a6921..283c465 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "eleventy-plugin-og-image": "^4.0.0", "eleventy-plugin-robotstxt": "^1.0.0", "markdown-it-abbr": "^2.0.0", + "markdown-it-anchor": "^9.2.0", "markdown-it-collapsible": "^2.0.2", "markdown-it-footnote": "^4.0.0", "markdown-it-obsidian-callouts": "^0.3.0", @@ -1333,6 +1334,31 @@ "@types/node": "*" } }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "license": "MIT", + "peer": true + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "license": "MIT", + "peer": true + }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -5145,6 +5171,16 @@ "integrity": "sha512-of7C8pXSjXjDojW4neNP+jD7inUYH/DO0Ca+K/4FUEccg0oHAEX/nfscw0jfz66PJbYWOAT9U8mjO21X5p6aAw==", "license": "MIT" }, + "node_modules/markdown-it-anchor": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.2.0.tgz", + "integrity": "sha512-sa2ErMQ6kKOA4l31gLGYliFQrMKkqSO0ZJgGhDHKijPf0pNFM9vghjAh3gn26pS4JDRs7Iwa9S36gxm3vgZTzg==", + "license": "Unlicense", + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, "node_modules/markdown-it-collapsible": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/markdown-it-collapsible/-/markdown-it-collapsible-2.0.2.tgz", diff --git a/package.json b/package.json index 15bbfb6..8ff8224 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "eleventy-plugin-og-image": "^4.0.0", "eleventy-plugin-robotstxt": "^1.0.0", "markdown-it-abbr": "^2.0.0", + "markdown-it-anchor": "^9.2.0", "markdown-it-collapsible": "^2.0.2", "markdown-it-footnote": "^4.0.0", "markdown-it-obsidian-callouts": "^0.3.0",