-
Notifications
You must be signed in to change notification settings - Fork 9
/
eleventy.config.js
53 lines (49 loc) · 2.14 KB
/
eleventy.config.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
import markdownIt from 'markdown-it';
import esbuild from './_source/_utilities/esbuild.js';
import lightingcss from './_source/_utilities/lightningcss.js';
import image from './_source/_utilities/image.js';
import style from './_source/_utilities/style.js';
import setVar from './_source/_utilities/setVar.js';
import fullDate from './_source/_utilities/fullDate.js';
import getRandom from './_source/_utilities/getRandom.js';
import markdownify from './_source/_utilities/markdownify.js';
import { IdAttributePlugin } from '@11ty/eleventy';
export default async function (eleventyConfig) {
/* --------------------------------------------------------------------------
Plugins, bundles, shortcodes, filters
-------------------------------------------------------------------------- */
eleventyConfig.addPlugin(esbuild);
eleventyConfig.addPlugin(lightingcss);
eleventyConfig.addPlugin(IdAttributePlugin);
eleventyConfig.addBundle('css', { transforms: [style] });
eleventyConfig.addShortcode('image', image);
eleventyConfig.addPairedShortcode('setVar', setVar);
eleventyConfig.addFilter('fullDate', fullDate);
eleventyConfig.addFilter('getRandom', getRandom);
eleventyConfig.addFilter('markdownify', markdownify);
/* --------------------------------------------------------------------------
MarkdownIt settings
-------------------------------------------------------------------------- */
const markdownItOptions = {
html: true,
typographer: true,
};
eleventyConfig.setLibrary('md', markdownIt(markdownItOptions));
/* --------------------------------------------------------------------------
Files & folders
-------------------------------------------------------------------------- */
eleventyConfig.ignores.add('.DS_Store');
eleventyConfig.setServerPassthroughCopyBehavior('passthrough');
eleventyConfig.addPassthroughCopy('_source/assets/fonts');
eleventyConfig.addPassthroughCopy('_source/assets/images');
return {
dir: {
input: '_source',
output: '_public',
layouts: '_layouts',
includes: '_includes',
},
templateFormats: ['html', 'md', 'liquid'],
htmlTemplateEngine: 'liquid',
};
}