-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eleventy.js
47 lines (38 loc) · 1.16 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 syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const markdownIt = require("markdown-it");
const markdownItAnchor = require("markdown-it-anchor");
const markdownItFootnote = require("markdown-it-footnote");
const rss = require("@11ty/eleventy-plugin-rss");
const inputDir = "src";
module.exports = function(conf) {
// Enable syntax highlighting
conf.addPlugin(syntaxHighlight);
// Enable RSS feed
conf.addPlugin(rss, {
posthtmlRenderOptions: {
closingSingleTag: "slash"
}
});
conf.addLiquidFilter("dateToRfc3339", rss.dateToRfc3339);
conf.addPassthroughCopy("CNAME");
conf.addPassthroughCopy("utterances.json");
conf.addPassthroughCopy("static");
const markdown = markdownIt("commonmark", {
typographer: true
});
markdown
.use(markdownItFootnote)
.use(markdownItAnchor, {
permalink: markdownItAnchor.permalink.headerLink({ safariReaderFix: true }),
});
conf.setLibrary("md", markdown);
conf.addCollection("blog", function(coll) {
return coll.getFilteredByGlob(inputDir + "/_blog/*.md").reverse();
})
return {
dir: {
input: inputDir,
layouts: "_layouts",
},
};
};