-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eleventy.js
51 lines (41 loc) · 1.67 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
const syntaxHighlightPlugin = require('@11ty/eleventy-plugin-syntaxhighlight');
const xmlPlugin = require('eleventy-xml-plugin');
const { markdownify, nbsp } = require('./.eleventy/filters');
const { all, archive, blog } = require('./.eleventy/collections');
const { codeExampleLink, codepen } = require('./.eleventy/shortcodes');
const { md } = require('./.eleventy/libraries');
const { htmlmin } = require('./.eleventy/transforms');
module.exports = function (eleventyConfig) {
/* LIQUID AND GLOBAL CONFIG */
eleventyConfig.setLiquidOptions({ dynamicPartials: true });
eleventyConfig.addLayoutAlias('base', 'layouts/base.liquid');
eleventyConfig.addLayoutAlias('home', 'layouts/home.liquid');
eleventyConfig.addLayoutAlias('default', 'layouts/default.liquid');
eleventyConfig.setUseGitIgnore(false);
/* PLUGINS */
eleventyConfig.addPlugin(xmlPlugin);
eleventyConfig.addPlugin(syntaxHighlightPlugin, { lineSeparator: '\n' });
/* FILTERS */
eleventyConfig.addFilter('nbsp', nbsp);
eleventyConfig.addFilter('markdownify', markdownify);
/* COLLECTIONS */
eleventyConfig.addCollection('blog', blog);
eleventyConfig.addCollection('archive', archive);
eleventyConfig.addCollection('all', all);
/* SHORT CODES */
eleventyConfig.addShortcode('codeExampleLink', codeExampleLink);
eleventyConfig.addShortcode('codepen', codepen);
/* MARKDOWN */
eleventyConfig.setLibrary('md', md);
/* COPY */
eleventyConfig.addPassthroughCopy('assets');
eleventyConfig.addPassthroughCopy('robots.txt');
/* HTML */
eleventyConfig.addTransform('htmlmin', htmlmin);
// return base config
return {
input: './',
output: './_site',
passthroughFileCopy: true
};
};