aboutsummaryrefslogtreecommitdiffstats
path: root/eleventy.config.js
blob: 9adfcf06f7df270bff13fde60fddb923b74092c4 (plain) (blame)
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
module.exports = eleventyConfig => {
  eleventyConfig.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight'))
  eleventyConfig.addPlugin(require('@11ty/eleventy-plugin-rss'))

  eleventyConfig.setLibrary('md', require('markdown-it')({
    html: true,
    linkify: true,
    typographer: true
  }).use(require('markdown-it-attrs')))

  const { DateTime } = require('luxon')
  eleventyConfig.addFilter('datefmt', date => {
    return DateTime.fromJSDate(date, { zone: 'utc' }).toFormat("dd LLL yyyy");
  })

  eleventyConfig.addPassthroughCopy('static/')
  eleventyConfig.addPassthroughCopy('favicon.svg')
  eleventyConfig.addPassthroughCopy('favicon.ico')

  return {
    dir: {
      input: 'src',
      output: 'dist',
      includes: 'includes',
      data: 'data',
      layouts: 'layouts'
    },

    dataTemplateEngine: 'njk',
    markdownTemplateEngine: 'njk',
    htmlTemplateEngine: 'njk',
    templateFormats: [
      'html',
      'md',
      'njk',
      '11ty.js'
    ]
  }
}