-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
41 lines (33 loc) · 967 Bytes
/
.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
let pluginRss = require("@11ty/eleventy-plugin-rss");
let markdownIt = require('markdown-it');
let taskLists = require('markdown-it-task-lists');
const WRITING_GLOB = './src/writing/*.md';
let markdownItOptions = {
breaks: true,
html: true,
linkify: true,
typographer: true
};
let md = markdownIt(markdownItOptions).use(taskLists, { label: true });
module.exports = function(config) {
config.addCollection('feed', (collection) => {
return [...collection.getFilteredByGlob(WRITING_GLOB)]
.reverse()
.slice(0,20);
});
config.addCollection('writing', (collection) => {
return [...collection.getFilteredByGlob(WRITING_GLOB)]
.reverse();
});
config.addPassthroughCopy({ './public': './' });
config.addPassthroughCopy('./src/img');
config.addPassthroughCopy('./src/styles');
config.addPlugin(pluginRss);
config.setLibrary('md', md);
return {
dir: {
input: 'src',
output: 'dist'
},
};
};