-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
53 lines (43 loc) · 1.6 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
const syntaxHighlightPlugin = require('@11ty/eleventy-plugin-syntaxhighlight')
const xmlPlugin = require('eleventy-xml-plugin')
const { markdownify, nbsp } = require('./.eleventy/filters')
const { all, archive, blogposts } = require('./.eleventy/collections')
const { actionLink, codepen, image } = 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('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('blogposts', blogposts)
eleventyConfig.addCollection('archive', archive)
eleventyConfig.addCollection('all', all)
/* SHORT CODES */
eleventyConfig.addShortcode('actionLink', actionLink)
eleventyConfig.addShortcode('codepen', codepen)
eleventyConfig.addShortcode('image', image)
/* 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
}
}