-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
43 lines (34 loc) · 1.06 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
const markdownIt = require("markdown-it");
const moment = require('moment');
moment.locale('en');
const readingTime = require('eleventy-plugin-reading-time');
module.exports = function(eleventyConfig) {
let mdIt = markdownIt({
html: true,
breaks: false,
linkify: true,
typographer: true,
quotes: '“”‘’',
});
eleventyConfig.setLibrary("md", mdIt);
eleventyConfig.addPairedShortcode("markdown", function(content) {
return mdIt.render(content);
});
eleventyConfig.addFilter('dateIso', date => {
return moment(date).toISOString();
});
eleventyConfig.addFilter('dateFormated', date => {
return moment(date).format('LL'); // E.g. May 31, 2019
});
eleventyConfig.addPlugin(readingTime);
eleventyConfig.addPassthroughCopy("_src/articles/img");
return {
markdownTemplateEngine: "njk",
dir: {
input: "_src",
includes: "_includes",
layouts: "_layouts"
}
// Your normal return options
};
};