forked from nerdhaus/eleventufte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
54 lines (45 loc) · 1.53 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
const pluginRss = require('@11ty/eleventy-plugin-rss')
const pluginNavigation = require('@11ty/eleventy-navigation')
const tufteWrapper = require('./util/tufteWrapper')
const searchFilter = require("./util/searchFilter");
const linkToHead = require("./util/linkToHead");
module.exports = function (eleventyConfig) {
// Plugins
eleventyConfig.addPlugin(pluginRss)
eleventyConfig.addPlugin(pluginNavigation)
eleventyConfig.addFilter("search", searchFilter);
eleventyConfig.addFilter("linkToHead", linkToHead);
// Asset Watch Targets
eleventyConfig.addWatchTarget('./src/assets')
/* Markdown Configuration */
let options = {
react: false,
};
// Markdown
eleventyConfig.setLibrary("md", tufteWrapper)
eleventyConfig.addFilter("markdown", tufteWrapper.render)
eleventyConfig.addFilter("markdownInline", tufteWrapper.renderInline)
// Layouts
eleventyConfig.addLayoutAlias('base', 'base.njk')
eleventyConfig.addLayoutAlias('simple', 'base.njk')
eleventyConfig.addLayoutAlias('post', 'base.njk')
// Pass-through files
eleventyConfig.addPassthroughCopy('src/admin')
eleventyConfig.addPassthroughCopy('src/assets')
eleventyConfig.addPassthroughCopy('src/uploads')
// Deep-Merge
eleventyConfig.setDataDeepMerge(true)
// Base Config
return {
dir: {
input: 'src',
output: 'dist',
includes: '_includes',
layouts: '_layouts',
data: '_data'
},
templateFormats: ['njk', 'md', '11ty.js'],
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk'
}
}