-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
47 lines (40 loc) · 1.18 KB
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const markdownIt = require("markdown-it");
const markdownItAnchor = require("markdown-it-anchor");
const markdownItFootnote = require("markdown-it-footnote");
const markdownItTOC = require("markdown-it-toc-done-right");
const markdownItAttrs = require('markdown-it-attrs');
const sourceDirectory = "src";
const md = markdownIt({
html: true,
linkify: true,
typographer: true,
});
md
.use(markdownItAnchor, {
permalink: true,
permalinkClass: "direct-link",
permalinkSymbol: "#",
})
.use(markdownItFootnote)
.use(markdownItTOC, {listType: "ol", containerId: "toc"})
.use(markdownItAttrs);
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy(`${sourceDirectory}/media`);
eleventyConfig.addPassthroughCopy(`${sourceDirectory}/css`);
eleventyConfig.addPlugin(pluginSyntaxHighlight);
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.setLibrary("md", md);
return {
templateFormats: [
"md",
"njk",
"html",
"liquid"
],
dir: {
input: sourceDirectory,
},
};
};