add markdown-it configuration

This commit is contained in:
M Sarmad Qadeer committed 2022-09-04 13:19:17 +05:00
1 parent 510297411b
commit 727bfb8ada
2 files changed
+15 -3

No files matched your search

+14 -3
View File
@@ -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: {
+1
View File
@@ -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"
}
}