-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
54 lines (46 loc) · 1.59 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
44
45
46
47
48
49
50
51
52
53
54
const filters = require('./utils/filters.js')
const transforms = require('./utils/transforms.js')
const collections = require('./utils/collections.js')
const tools = require('./utils/tools.js')
const pluginRss = require('@11ty/eleventy-plugin-rss')
const pluginNavigation = require('@11ty/eleventy-navigation')
module.exports = function (eleventyConfig) {
// Folders to copy to build dir (See. 1.1)
eleventyConfig.addPassthroughCopy("src/static");
eleventyConfig.addPassthroughCopy("src/_img");
eleventyConfig.addPlugin(pluginRss)
eleventyConfig.addPlugin(pluginNavigation)
// 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])
})
// Tools
Object.keys(tools).forEach((toolName) => {
eleventyConfig.addFilter(toolName, tools[toolName])
})
// This allows Eleventy to watch for file changes during local development.
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addLayoutAlias('page', 'page.njk')
eleventyConfig.addLayoutAlias('post', 'post.njk')
return {
dir: {
input: "src/",
output: "dist",
includes: "_includes",
layouts: "_layouts",
img: "_img",
},
templateFormats: ["html", "md", "njk"],
htmlTemplateEngine: "njk",
// 1.1 Enable eleventy to pass dirs specified above
passthroughFileCopy: true
};
};