-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
47 lines (40 loc) · 1.21 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 rssPlugin = require('@11ty/eleventy-plugin-rss');
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const markdownIt = require("markdown-it");
const markdownItAnchor = require("markdown-it-anchor");
const formatDate = require('./utils/date.js');
const { figure, note, stream, youtube } = require('./utils/shortcodes.js');
module.exports = function(config) {
config.setFrontMatterParsingOptions({
summary: true
});
config.addPlugin(rssPlugin);
config.addPlugin(syntaxHighlight);
config.addFilter('dateFilter', formatDate);
config.addPassthroughCopy("assets");
config.addPassthroughCopy("writing/assets");
/* Markdown Plugins */
const options = {
html: true,
breaks: true,
linkify: true
};
const opts = {
level: [1, 2, 3],
permalink: false
};
config.setLibrary("md", markdownIt(options)
.use(markdownItAnchor, opts)
);
/* Shortcodes */
config.addShortcode("youtube", youtube);
config.addShortcode("stream", stream);
config.addPairedShortcode("figure", figure);
config.addPairedShortcode("note", note);
return {
dir: {
includes: "assets",
layouts: "templates"
}
};
};