-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
38 lines (27 loc) · 1.04 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
module.exports = function(eleventyConfig) {
// add static passthrough
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addPassthroughCopy("reveal");
eleventyConfig.addPassthroughCopy("slides");
eleventyConfig.addPassthroughCopy("favicon.ico");
// add filters
eleventyConfig.addFilter("cssmin", require("./plugins/clean-css.js") );
eleventyConfig.addNunjucksAsyncFilter("jsmin", require("./plugins/clean-js.js"))
// configure markdown engine
let md = require("./plugins/customize-markdown.js")()
eleventyConfig.setLibrary("md", md);
// split master slide into collection
eleventyConfig.addCollection("slides", col => {
let slideCol = col.getFilteredByGlob("slides/index.md");
let master = slideCol[0]
let index = master.template.frontMatter.content.split(/\r?\n---\r?\n/)
let slides = index.map(s => md.render(s))
return slides
});
return {
dir: {
includes: "assets",
layouts: "layouts"
}
};
};