-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eleventy.js
55 lines (43 loc) · 1.49 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
55
const CleanCSS = require("clean-css");
const markdownIt = require('markdown-it');
const markdownItAttrs = require('markdown-it-attrs');
const sal = require('sal.js');
const lazyImagesPlugin = require('eleventy-plugin-lazyimages');
const cacheBuster = require('@mightyplow/eleventy-plugin-cache-buster');
const markdownItOptions = {
html: true,
breaks: true,
linkify: true
}
const markdownLib = markdownIt(markdownItOptions).use(markdownItAttrs)
module.exports = function(eleventyConfig) {
eleventyConfig.setLibrary('md', markdownLib)
eleventyConfig.addPlugin(lazyImagesPlugin);
const cacheBusterOptions = {
outputDirectory: 'dist',
createResourceHash(outputDirectoy, url, target) {
return Date.now();
}
};
eleventyConfig.addPlugin(cacheBuster(cacheBusterOptions));
// Set directories to pass through to the dist folder
eleventyConfig.addPassthroughCopy('./src/assets/img/');
eleventyConfig.addPassthroughCopy('./src/assets/fonts/');
eleventyConfig.addPassthroughCopy('./src/assets/js/');
eleventyConfig.addPassthroughCopy('./src/assets/favicons/');
eleventyConfig.addPassthroughCopy({
"node_modules/sal.js/dist/sal.css": "sal.css",
"node_modules/sal.js/dist/sal.css.map": "sal.css.map",
"node_modules/sal.js/dist/sal.js": "assets/js/sal.js",
"node_modules/sal.js/dist/sal.js.map": "assets/js/sal.js.map"
});
eleventyConfig.setLiquidOptions({
dynamicPartials: true
});
return {
dir: {
input: 'src',
output: 'dist'
}
};
};