forked from ravynsoft/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
39 lines (32 loc) · 1.07 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
const eleventyNavigationPlugin = require('@11ty/eleventy-navigation')
const dateFns = require('date-fns')
const MarkdownIt = require('markdown-it')
module.exports = function (config) {
config.addPassthroughCopy({ 'public/css': 'css' })
config.addPassthroughCopy({ 'public/fonts': 'fonts' })
config.addPassthroughCopy({ 'public/images': 'images' })
config.addPassthroughCopy({ 'public/js': 'js' })
config.addPassthroughCopy('_redirects')
// Watch and rebuild when styles change.
config.addWatchTarget('./src/styles')
config.addPlugin(eleventyNavigationPlugin)
config.addFilter('githubDateFmt', (obj) => {
const parsedDate = dateFns.parseISO(obj)
const formatted = dateFns.format(parsedDate, 'do LLL yyyy')
return formatted
})
config.addShortcode('year', () => `${new Date().getFullYear()}`)
const markdown = new MarkdownIt()
config.addFilter('markdown', (obj) => {
return markdown.render(obj)
})
return {
dir: {
input: 'src',
output: 'dist',
includes: '_includes',
layouts: '_layouts',
data: '_data',
},
}
}