Adds markdown-it-anchor plugin

This commit is contained in:
Zach Leatherman
2018-06-18 09:00:00 -05:00
parent 5115c4409c
commit 4185f33c15
6 changed files with 45 additions and 1 deletions

View File

@@ -22,6 +22,24 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPassthroughCopy("css");
/* Markdown Plugins */
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
let options = {
html: true,
breaks: true,
linkify: true
};
let opts = {
permalink: true,
permalinkClass: "direct-link",
permalinkSymbol: "#"
};
eleventyConfig.setLibrary("md", markdownIt(options)
.use(markdownItAnchor, opts)
);
return {
templateFormats: [
"md",