-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eleventy.js
40 lines (31 loc) · 1.25 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
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const dateFilterPlugin = require('nunjucks-date-filter');
const markdownIt = require('markdown-it')
const markdownItAttrs = require('markdown-it-attrs')
const markdownItOptions = {
html: true,
breaks: true,
linkify: true
}
const markdownLib = markdownIt(markdownItOptions).use(markdownItAttrs)
module.exports = function(eleventyConfig) {
eleventyConfig.setLibrary('md', markdownLib)
eleventyConfig.addPlugin(eleventyNavigationPlugin);
// Copy assets
eleventyConfig.addPassthroughCopy("assets/img/**/*")
eleventyConfig.addPassthroughCopy("assets/js/**/*")
eleventyConfig.addPassthroughCopy("assets/fonts/**/*")
eleventyConfig.addPassthroughCopy("assets/pdf/**/*")
eleventyConfig.addPassthroughCopy("hw/**/*")
eleventyConfig.addPassthroughCopy("old/**/*")
eleventyConfig.ignores.add("old/**/*")
// Copy favicon stuff
eleventyConfig.addPassthroughCopy("*.png")
eleventyConfig.addPassthroughCopy("*.svg")
eleventyConfig.addPassthroughCopy("*.ico")
eleventyConfig.addPassthroughCopy("site.webmanifest")
eleventyConfig.addPassthroughCopy("browserconfig.xml")
eleventyConfig.addFilter("toISO", (dateObj) => {
return dateObj.toISOString().substring(0, 10);
});
};