-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
40 lines (34 loc) · 1.22 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
module.exports = function(eleventyConfig) {
const moment = require("moment");
eleventyConfig.addPassthroughCopy({ "./node_modules/wet-boew/" : "wet-boew" });
eleventyConfig.addPassthroughCopy({ "./node_modules/gcweb/" : "gcweb" });
eleventyConfig.addPassthroughCopy({ "./src/_docs" : "docs" });
eleventyConfig.addPassthroughCopy({ "./src/_images" : "img" });
eleventyConfig.addPassthroughCopy({ "./src/CNAME" : "CNAME" });
// date filter (localized)
eleventyConfig.addNunjucksFilter("date", function (date, format, locale) {
locale = locale ? locale : "en";
moment.locale(locale);
return moment(date).format(format);
});
// Localized collections
eleventyConfig.addCollection("posts_en", function (collection) {
return collection.getFilteredByGlob("./src/en/posts/*.md");
});
eleventyConfig.addCollection("posts_fr", function (collection) {
return collection.getFilteredByGlob("./src/fr/posts/*.md");
});
return {
dir: {
input : "src",
output : "_site",
includes : "_includes",
data : "_data"
},
templateFormats : ["html", "md", "njk", "css"],
htmlTemplateEngine : "njk",
markdownTemplate : "njk",
setUseGitIgnore : false
// pathPrefix : "/gc-da11yn.github.io/"
};
}