-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
49 lines (43 loc) · 1.26 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
// inspired by https://github.com/webpixels/bootstrap-starter-kit
const markdownIt = require("markdown-it");
const { EleventyRenderPlugin } = require("@11ty/eleventy");
module.exports = function(config) {
config.addPassthroughCopy('src/assets')
config.addWatchTarget("./src/");
config.addWatchTarget("./src/scss");
config.addLayoutAlias("layout1", "layout1.njk");
config.addPlugin(EleventyRenderPlugin);
config.addCollection("works",(collection) => {
return collection.getFilteredByGlob("./src/content/works/*.md")
.map(element => {
element.data = Object.assign({ // default
ord: 0,
visible: true,
}, element.data);
return element;
})
.filter(element => element.data.visible)
.sort((a, b) => b.data.ord - a.data.ord)
});
config.addShortcode("year_current", () => `${new Date().getFullYear()}`);
/*
let options = {
html: true,
breaks: true,
linkify: true
};
config.setLibrary("md", markdownIt(options));
*/
return {
dir: {
input: "src",
output: "dist",
includes: "includes",
data: "data",
},
templateFormats: ["html", "njk", "md", "11ty.js"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
//passthroughFileCopy: true
};
}