-
Notifications
You must be signed in to change notification settings - Fork 32
/
eleventy.js
48 lines (41 loc) · 1.73 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
const markdown = require('./eleventy/markdown.js');
const { version: buildVersion } = require('./package.json');
const { EleventyRenderPlugin } = require('@11ty/eleventy');
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
const eleventyEvents = require('./eleventy/events');
module.exports = function (eleventyConfig) {
eleventyEvents.init(eleventyConfig);
// Filters & Shortcodes
require('./eleventy/filters.js')(eleventyConfig);
require('./eleventy/localize')(eleventyConfig);
require('./eleventy/categories.js')(eleventyConfig);
require('./eleventy/tutorials.js')(eleventyConfig);
require('./eleventy/shortcodes.js')(eleventyConfig);
// File Structure
eleventyConfig.addPassthroughCopy('public');
eleventyConfig.addPassthroughCopy({ 'assets/favicon': '/' });
eleventyConfig.addPassthroughCopy({ 'assets/images': 'public/images-original' });
eleventyConfig.addPassthroughCopy({ 'assets/example-catalog': 'public/example-catalog' });
eleventyConfig.addPassthroughCopy('notebooks/src');
eleventyConfig.addWatchTarget('../public/**/*');
eleventyConfig.addWatchTarget('../config/**/*');
// Settings
eleventyConfig.addGlobalData('buildversion', buildVersion);
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.setDataDeepMerge(true);
eleventyConfig.setLibrary('md', markdown);
// Plugins
eleventyConfig.addPlugin(syntaxHighlight, {});
eleventyConfig.addPlugin(EleventyRenderPlugin);
// Options
return {
dir: {
input: 'app',
output: '_site',
includes: '_partials',
layouts: '_layouts',
},
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
};
};