Created
September 29, 2020 09:28
-
-
Save surjithctly/a4efce868823f6ddb34a51ff88350edd to your computer and use it in GitHub Desktop.
Eleventy markdown Plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (eleventyConfig) { | |
/* Markdown Plugins */ | |
let markdownIt = require("markdown-it"); | |
let markdownItAnchor = require("markdown-it-anchor"); | |
let options = { | |
html: true, | |
breaks: true, | |
linkify: true, | |
}; | |
let opts = { | |
permalink: false, | |
}; | |
eleventyConfig.setLibrary( | |
"md", | |
markdownIt(options).use(markdownItAnchor, opts) | |
); | |
return { | |
templateFormats: ["md", "njk", "html", "liquid"], | |
markdownTemplateEngine: "liquid", | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment