-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
37 lines (36 loc) · 1.14 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) {
// Handlebars Helper
eleventyConfig.addPairedHandlebarsShortcode("ifSame", function(content, arg1, arg2) {
if(arg1 === arg2) {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("ifEven", function(content, index) {
if ((index == 0) || (index%2 == 0)) {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("ifOdd", function(content, index) {
if (index%2 != 0) {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("ifVideo", function(content, type) {
if (type == "video") {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("ifGif", function(content, type) {
if (type == "gif") {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("ifImage", function(content, type) {
if (type == "image") {
return content;
}
});
eleventyConfig.addPairedHandlebarsShortcode("token", function(content, type) {
return Date.now();
});
};