-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
38 lines (32 loc) · 1.05 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
module.exports = function (eleventyConfig) {
let options = {
html: true,
breaks: true,
linkify: true,
}
let markdownIt = require('markdown-it')(options)
.use(require('markdown-it-bracketed-spans'))
.use(require('markdown-it-attrs'))
eleventyConfig.setLibrary('md', markdownIt)
eleventyConfig.addPassthroughCopy('./src/assets/')
eleventyConfig.addWatchTarget('./src/assets/')
eleventyConfig.addPairedShortcode('year', function (date) {
const currentYear = new Date().getFullYear()
let result = currentYear - date
result.toString()
return `${result}`
})
eleventyConfig.addCollection('navigation', function (collectionApi) {
return collectionApi.getFilteredByGlob(['./src/*.md', './src/*.njk'])
})
return {
dir: {
input: 'src',
output: '_site',
},
templateFormats: ['md', 'njk', 'html'],
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
}
}