generated from chrissy-dev/eleventy-web-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
executable file
·40 lines (33 loc) · 1.08 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
const filters = require('./utils/filters.js')
const transforms = require('./utils/transforms.js')
const collections = require('./utils/collections.js')
module.exports = function (eleventyConfig) {
// Folders to copy to build dir (See. 1.1)
eleventyConfig.addPassthroughCopy("src/static");
// Filters
Object.keys(filters).forEach((filterName) => {
eleventyConfig.addFilter(filterName, filters[filterName])
})
// Transforms
Object.keys(transforms).forEach((transformName) => {
eleventyConfig.addTransform(transformName, transforms[transformName])
})
// Collections
Object.keys(collections).forEach((collectionName) => {
eleventyConfig.addCollection(collectionName, collections[collectionName])
})
// This allows Eleventy to watch for file changes during local development.
eleventyConfig.setUseGitIgnore(false);
return {
dir: {
input: "src/",
output: "dist",
includes: "_includes",
layouts: "_layouts"
},
templateFormats: ["html", "md", "njk"],
htmlTemplateEngine: "njk",
// 1.1 Enable eleventy to pass dirs specified above
passthroughFileCopy: true
};
};