-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
33 lines (27 loc) · 970 Bytes
/
.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
const lightningCSS = require('@11tyrocks/eleventy-plugin-lightningcss');
const dayjs = require('dayjs');
const filters = require('./src/_11ty/filters');
const { EleventyEdgePlugin } = require('@11ty/eleventy');
// console.log('hello from .eleventy.js', process.env);
module.exports = (eleventyConfig) => {
// Copy files
eleventyConfig.addPassthroughCopy('./src/images');
eleventyConfig.addPassthroughCopy('./src/favicon');
eleventyConfig.addPassthroughCopy('./src/scripts');
// Add plugins
eleventyConfig.addPlugin(lightningCSS);
eleventyConfig.addPlugin(EleventyEdgePlugin);
// Create shortcodes
eleventyConfig.addShortcode('year', () => `${new dayjs().year()}`);
eleventyConfig.addShortcode('today', () => `${new dayjs()}`);
// Create filters
Object.keys(filters).forEach((filterName) => {
eleventyConfig.addFilter(filterName, filters[filterName]);
});
return {
dir: {
input: 'src',
output: 'dist',
},
};
};