-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eleventy.js
44 lines (39 loc) · 1.11 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
const pluginTOC = require('eleventy-plugin-toc')
const htmlmin = require("html-minifier");
module.exports = function(eleventyConfig) {
eleventyConfig.setLibrary(
'md',
markdownIt = require('markdown-it')({
html: true
}).use(require('markdown-it-anchor')
));
eleventyConfig.addPlugin(pluginTOC, {
tags: ['h1', 'h2', 'h3'],
wrapper: 'div'
});
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
if( outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
return minified;
}
});
eleventyConfig.addPassthroughCopy({
"src/site/_includes/css/*.css" : "assets/css",
"src/site/_includes/js/*.js" : "assets/js",
"src/site/_data/fonts/authentic-sans/*" : "assets/fonts/authentic-sans",
"src/site/_data/fonts/lanapixel/*" : "assets/fonts/lanapixel",
});
return {
dir: {
input: "src/site",
output: "dist",
includes: "_includes",
layouts: "_includes/layouts",
data: "_data"
}
}
}