-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
45 lines (36 loc) · 1.1 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
const markdown = require('markdown-it')
const markdownAnchor = require('markdown-it-anchor')
const filters = require('./11ty/filters')
const shortcodes = require('./11ty/shortcodes')
const pairedShortcodes = require('./11ty/paired-shortcodes')
module.exports = function(eleventyConfig) {
eleventyConfig.addWatchTarget('./sass/')
eleventyConfig.addPassthroughCopy('static')
const md = markdown({
html: true,
breaks: false,
linkify: false
})
md.disable('code')
md.use(markdownAnchor, { slugify: filters.slugify })
eleventyConfig.setLibrary('md', md)
for (const [key, value] of Object.entries(filters)) {
eleventyConfig.addFilter(key, value)
}
for (const [key, value] of Object.entries(shortcodes)) {
eleventyConfig.addShortcode(key, value)
}
for (const [key, value] of Object.entries(pairedShortcodes)) {
eleventyConfig.addPairedShortcode(key, value)
}
return {
dir: {
input: 'src',
output: 'dist',
layouts: '_layouts'
},
templateFormats: ['md', '11ty.js', 'njk'],
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk'
}
}