forked from simonpannek/PGDPde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eleventy.config.js
50 lines (39 loc) · 1.45 KB
/
eleventy.config.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
// Imports
const filters = require("./filters");
const transforms = require("./transforms");
const collections = require("./collections");
// Shortcodes
const { FontAwesomeIcon } = require("./modules/fontawesome-svg");
module.exports = config => {
// Data merge
config.setDataDeepMerge(true);
// Pass through
config.addPassthroughCopy("src/assets/favicon/*");
config.addPassthroughCopy("src/assets/img/*");
config.addPassthroughCopy("src/assets/sound/*");
config.addPassthroughCopy({"src/tutors/img/*": "assets/img/"});
// Layouts
config.addLayoutAlias("default", "layouts/default.njk");
config.addLayoutAlias("card", "layouts/card.njk");
// Filters
config.addNunjucksFilter("hashString", filters.hashString);
config.addNunjucksFilter("mapToColor", filters.mapToColor);
config.addNunjucksFilter("mapToLink", filters.mapToLink);
// Transforms
config.addTransform('purge-styles', transforms.purgeStyles);
config.addTransform("minify", transforms.minify);
// Collections
config.addCollection("allSorted", collections.allSortedColl);
config.addCollection("cards", collections.cards);
// Shortcodes
config.addNunjucksShortcode("FontAwesomeIcon", FontAwesomeIcon);
return {
dir: {
input: "src",
output: "build"
},
templateFormats: ["md", "njk", "html"],
dataTemplateEngine: "njk",
markdownTemplateEngine: "njk"
}
}