/
eleventy.config.cjs
38 lines (31 loc) · 958 Bytes
/
eleventy.config.cjs
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
// External imports
require("dotenv").config();
// Internal imports
module.exports = function (eleventyConfig) {
// Plugins
eleventyConfig.addPlugin(require("./src/_11ty/plugins/plugins.cjs"));
// Filters
eleventyConfig.addPlugin(require("./src/_11ty/filters/filters.cjs"));
// Shortcodes
eleventyConfig.addPlugin(require("./src/_11ty/shortcodes/shortcodes.cjs"));
// Collections
const types = ["article", "bookmark"];
for (const type of types) {
eleventyConfig.addCollection(type, (collectionApi) =>
collectionApi.getAll().filter((item) => item.data.type === type)
);
}
// Passthrough copy
eleventyConfig.addPassthroughCopy({ "src/assets": "assets" });
return {
templateFormats: ["html", "md", "njk", "webc"],
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
dir: {
input: "src/input",
includes: "../_includes", // Relative to input
data: "../_data", // Relative to input
output: "_site",
},
};
};