-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
executable file
·65 lines (53 loc) · 1.78 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const pluginMetagen = require('eleventy-plugin-metagen');
module.exports = function(eleventyConfig) {
eleventyConfig.setQuietMode(true);
eleventyConfig.addWatchTarget("./src/css/");
eleventyConfig.setDataDeepMerge(true);
// plugins
eleventyConfig.addPlugin(pluginMetagen);
// template filters
eleventyConfig.addFilter("date", require("./filters/date.js") );
eleventyConfig.addFilter("limit", require("./filters/limit.js") );
// excerpts for posts
eleventyConfig.setFrontMatterParsingOptions({
excerpt: true,
excerpt_separator: "<!-- excerpt -->",
excerpt_alias: 'intro'
});
// manually configure markdown-it
let markdownIt = require("markdown-it");
let markdownItFootnote = require("markdown-it-footnote");
let options = {
html: true,
typographer: true,
quotes: '“”‘’'
};
let markdownLib = markdownIt(options).use(markdownItFootnote);
eleventyConfig.setLibrary("md", markdownLib);
eleventyConfig.addPassthroughCopy("src/**/*.gif");
eleventyConfig.addPassthroughCopy("src/**/*.jpg");
eleventyConfig.addPassthroughCopy("src/**/*.jpeg");
eleventyConfig.addPassthroughCopy("src/**/*.png");
eleventyConfig.addPassthroughCopy("src/**/*.svg");
eleventyConfig.addPassthroughCopy("src/**/*.pdf");
eleventyConfig.addPassthroughCopy("src/js/");
eleventyConfig.addPassthroughCopy({"src/_meta": "/"});
return {
dir: {
input: "src",
output: "_site",
// includes: "/_includes",
layouts: "/_layouts"
},
templateFormats : [
"html",
"njk",
"md",
"11ty.js"
],
// always Nunjuk so we can use dynamic permalinks in the template
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
passthroughFileCopy: true // unhandled types above will be simply copied
};
};