-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
43 lines (37 loc) · 1.21 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
const dayjs = require('dayjs');
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const eleventySass = require("eleventy-sass");
module.exports = function(eleventyConfig){
// eleventyConfig.addPassthroughCopy("src/assets/css/style.css");
eleventyConfig.addPassthroughCopy("src/assets/images");
eleventyConfig.addShortcode(
"headers",
(title, subtitle) =>
`<h1>${title}</h1>
<p>${subtitle}</p>`
);
eleventyConfig.addCollection("page", function(collections) {
return collections.getFilteredByTag("page").sort(function(a, b) {
return a.data.order - b.data.order;
});
});
eleventyConfig.addFilter('formatDate', function(date, format) {
return dayjs(date).format(format)
});
// PLUGINS
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(eleventySass, {
sass: {
loadPaths: ["./node_modules/nord/src/sass/", "./src/assets/scss/"]
}
});
return {
dir: {
input: "src",
data: "_data",
includes: "_includes",
layouts: "_layouts",
output: "public"
}
};
}