-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
56 lines (46 loc) · 2.01 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
const eleventyNavigationPlugin = require('@11ty/eleventy-navigation');
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const imageShortcode = require('./src/_11ty/shortcodes/image-shortcode');
const markdownLibrary = require('./src/_11ty/libraries/markdown-library');
const minifyHtml = require('./src/_11ty/utils/minify-html');
const markdownFilter = require('./src/_11ty/filters/markdown-filter');
const svgFilter = require('./src/_11ty/filters/svg-filter');
const browserSyncConfig = require('./src/_11ty/utils/browser-sync-config');
const { readableDateFilter, machineDateFilter } = require('./src/_11ty/filters/date-filters');
module.exports = function (eleventyConfig) {
// Plugins
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(syntaxHighlight);
// Filters
eleventyConfig.addFilter('markdown', markdownFilter);
eleventyConfig.addFilter('readableDate', readableDateFilter);
eleventyConfig.addFilter('machineDate', machineDateFilter);
eleventyConfig.addFilter('svg', svgFilter);
// Shortcodes
eleventyConfig.addNunjucksAsyncShortcode('image', imageShortcode);
// Libraries
eleventyConfig.setLibrary('md', markdownLibrary);
// Merge data instead of overriding
eleventyConfig.setDataDeepMerge(true);
// Trigger a build when files in this directory change
eleventyConfig.addWatchTarget('./src/assets/scss/');
// Minify HTML output
eleventyConfig.addTransform('htmlmin', minifyHtml);
// Don't process folders with static assets
eleventyConfig.addPassthroughCopy('./src/favicon.ico');
eleventyConfig.addPassthroughCopy('./src/admin');
eleventyConfig.addPassthroughCopy('./src/assets/img');
// Allow Turbolinks to work in development mode
eleventyConfig.setBrowserSyncConfig(browserSyncConfig);
return {
templateFormats: ['md', 'njk', 'html'],
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
passthroughFileCopy: true,
dir: {
input: 'src',
layouts: "_layouts"
},
};
};