-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
36 lines (33 loc) · 1.01 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
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
const htmlmin = require('html-minifier')
module.exports = function (eleventyConfig) {
eleventyConfig.setTemplateFormats('11ty.js,md')
eleventyConfig.addPassthroughCopy('static')
// add recursive font from Fontsource
eleventyConfig.addPassthroughCopy({
'node_modules/@fontsource/recursive/files/recursive-latin-variable-full-normal.woff2':
'static/fonts/recursive.woff2',
})
// add syntax highlighting plugin
eleventyConfig.addPlugin(syntaxHighlight)
// minify html using html-minifier
eleventyConfig.addTransform('htmlmin', function (content, outputPath) {
if (outputPath.endsWith('.html')) {
return htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
})
}
return content
})
return {
passtroughFileCopy: true,
dir: {
input: '.',
includes: '_includes',
data: '_data',
output: '_site',
},
}
}