-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheleventy.config.js
48 lines (38 loc) · 1.26 KB
/
eleventy.config.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
const plugins = require('./plugins');
const navigationData = require('./navigation-data');
module.exports = (eleventyConfig) => {
// custom watch targets
eleventyConfig.addWatchTarget('./src/assets');
eleventyConfig.addWatchTarget('./src/game');
eleventyConfig.addPlugin(plugins);
// Collections
eleventyConfig.addCollection('slides', function (collectionApi) {
const all = collectionApi.getAll();
return navigationData
.map((fileSlug) => all.find((item) => item.fileSlug === fileSlug))
.filter(Boolean);
});
// short codes
eleventyConfig.addShortcode('year', () => `${new Date().getFullYear()}`); // current year, stephanie eckles
// passthrough copy
eleventyConfig.addPassthroughCopy('src/images');
// social icons to root directory
eleventyConfig.addPassthroughCopy({
'src/assets/images/favicon/*': '/',
});
eleventyConfig.addPassthroughCopy({
'src/assets/css/global.css': 'src/_includes/global.css',
});
// Tell 11ty to use the .eleventyignore and ignore our .gitignore file
eleventyConfig.setUseGitIgnore(false);
return {
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
output: 'dist',
input: 'src',
includes: '_includes',
layouts: '_layouts',
},
};
};