-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eleventy.js
50 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
45
46
47
48
49
50
// config for https://www.11ty.io/
let htmlmin = require("html-minifier")
function htmlMinifier(content, outputPath) {
if (!outputPath.endsWith(".html"))
return content;
return htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
}
module.exports = function(eleventyConfig) {
eleventyConfig.templateFormats = [
"md","css"
]
// differ markdown processor
let markdownIt = require("markdown-it")
let options = {
html: true,
breaks: true,
linkify: true,
typographer: true
}
let md = markdownIt(options)
// add KaTeX support
let mk = require('markdown-it-katex')
md.use(mk);
// add `[x]` and `[ ]` checkmark support
md.use(require('markdown-it-checkbox'))
eleventyConfig.setLibrary("md", md);
eleventyConfig.passthroughFileCopy = true
eleventyConfig.dir = {
input: "content",
output: "public",
includes: "templates"
}
eleventyConfig.addTransform("html-minifier", htmlMinifier)
return eleventyConfig
}