Skip to content

Instantly share code, notes, and snippets.

@surjithctly
Created September 29, 2020 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save surjithctly/a4efce868823f6ddb34a51ff88350edd to your computer and use it in GitHub Desktop.
Save surjithctly/a4efce868823f6ddb34a51ff88350edd to your computer and use it in GitHub Desktop.
Eleventy markdown Plugin
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