-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
59 lines (48 loc) · 1.99 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
48
49
50
51
52
53
54
55
56
57
58
59
const i18n = require('eleventy-plugin-i18n');
const sortByDisplayOrder = require('./src/utils/sort-by-display-order.js');
// Filters
// const dateFilter = require('./src/filters/date-filter.js');
// const timeFilter = require('./src/filters/time-filter.js');
// const w3DateFilter = require('./src/filters/w3-date-filter.js');
const markdownIt = require('markdown-it');
const markdownItAttrs = require('markdown-it-attrs');
const markdownItDeflist = require('markdown-it-deflist');
const markdownItLinkAttrs = require('markdown-it-link-attributes');
const markdownItOptions = {
html: true,
breaks: true,
linkify: true
}
const markdownLib = markdownIt(markdownItOptions).use(markdownItAttrs).use(markdownItDeflist).use(markdownItLinkAttrs)
module.exports = config => {
// Add filters
// config.addFilter('dateFilter', dateFilter);
// config.addFilter('timeFilter', timeFilter);
// config.addFilter('w3DateFilter', w3DateFilter);
config.addPassthroughCopy('./src/img/');
config.addPassthroughCopy('./src/css/');
config.addPassthroughCopy('./src/files/');
config.addPassthroughCopy('./src/js/');
// Returns subpages, sorted by display order
config.addCollection('nav_cs', collection => {
return sortByDisplayOrder(collection.getFilteredByGlob('./src/icebreaking/cs/*.md'));
});
// Returns subpages, sorted by display order
config.addCollection('nav_en', collection => {
return sortByDisplayOrder(collection.getFilteredByGlob('./src/icebreaking/en/*.md'));
});
// config.addShortcode("year", () => `${new Date().getFullYear()}`);
// config.addShortcode("now", () => `${Date.now()}`);
// Tell 11ty to use the .eleventyignore and ignore our .gitignore file
config.setUseGitIgnore(false);
config.setLibrary('md', markdownLib)
return {
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
input: 'src',
output: '_site'
}
};
};