Install markdown-it-attrs and markdown-it-bracketed-spans plugins
This commit is contained in:
@@ -9,4 +9,22 @@ const markdownIt = require("markdown-it");
|
||||
module.exports = function (eleventyConfig) {
|
||||
// Installed plugins
|
||||
eleventyConfig.addPlugin(embedEverything, { add: ['soundcloud'] });
|
||||
|
||||
/* Markdown Overrides */
|
||||
let markdownLibrary = markdownIt({
|
||||
html: true,
|
||||
})
|
||||
.use(require("markdown-it-attrs"))
|
||||
.use(require("markdown-it-bracketed-spans"))
|
||||
|
||||
// Paired shortcode: custom container
|
||||
eleventyConfig.addPairedShortcode('container', (children, el, className) => {
|
||||
const classMarkup = className ? ` class="${className}"` : "";
|
||||
const content = markdownLibrary.render(children);
|
||||
return `<${el}${classMarkup}>${content}</${el}>`;
|
||||
});
|
||||
|
||||
/* This is the part that tells 11ty to swap to our custom config */
|
||||
eleventyConfig.setLibrary("md", markdownLibrary);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
"@11ty/eleventy-plugin-rss": "^1.2.0",
|
||||
"@11tyrocks/eleventy-plugin-emoji-readtime": "^1.0.1",
|
||||
"eleventy-plugin-embed-everything": "^1.18.2",
|
||||
"eleventy-plugin-metagen": "^1.8.3"
|
||||
"eleventy-plugin-metagen": "^1.8.3",
|
||||
"markdown-it-attrs": "^4.1.6",
|
||||
"markdown-it-bracketed-spans": "^1.0.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user