diff --git a/website/.eleventy.js b/website/.eleventy.js index d64de67818..5a6ed8b3d4 100644 --- a/website/.eleventy.js +++ b/website/.eleventy.js @@ -1,5 +1,3 @@ -// const Card = require('./src/_includes/components/Card'); - module.exports = function (eleventyConfig) { // Keeps the same directory structure. eleventyConfig.addPassthroughCopy("src/assets/"); @@ -17,7 +15,20 @@ module.exports = function (eleventyConfig) { eleventyConfig.addWatchTarget("markdown/"); eleventyConfig.addWatchTarget("components/Card.js"); - // eleventyConfig.addShortcode("Card",Card); + // this works because Eleventy also installs markdown-it + const markdownIt = require("markdown-it"); + + // create a new markdown-it instance with the plugin + const markdownItAnchor = require("markdown-it-anchor"); + + const markdownLib = markdownIt({ + html: true, + breaks: true, + linkify: true + }).use(markdownItAnchor); + + // replace the default markdown-it instance + eleventyConfig.setLibrary("md", markdownLib); return { dir: { diff --git a/website/package.json b/website/package.json index c96929fd94..0ff352ed7c 100644 --- a/website/package.json +++ b/website/package.json @@ -16,6 +16,7 @@ "devDependencies": { "@11ty/eleventy": "^1.0.1", "common-tags": "^1.8.2", + "markdown-it-anchor": "^8.6.4", "tailwindcss": "^3.0.24" } }