-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
34 lines (32 loc) · 1.33 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
const yaml = require('js-yaml');
const responsiveImage = require('./src/js/shortcodes/responsive-images.js');
const icon = require('./src/js/shortcodes/icon.js');
const parseMiniMd = require('./src/js/filters/parse-mini-markdown.js');
const license = require('./src/js/shortcodes/license.js');
const photoAttribution = require('./src/js/shortcodes/photo-attribution.js');
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({ 'src/public': '/' });
eleventyConfig.addPassthroughCopy({ 'src/icons': '/icons/' });
eleventyConfig.addLayoutAlias('default', 'layout.njk');
eleventyConfig.addDataExtension('yaml', (contents) => yaml.load(contents));
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addFilter('md', parseMiniMd);
eleventyConfig.addShortcode('image', responsiveImage);
eleventyConfig.addShortcode('icon', icon);
eleventyConfig.addShortcode('license', license);
eleventyConfig.addShortcode('photoAttribution', photoAttribution);
return {
dir: {
input: 'pages',
output: 'dist',
includes: '../src',
data: '../data',
},
pathPrefix:
process.env.ELEVENTY_RUN_MODE === 'build'
? '/birdhouse-recipes/'
: '/', // serve, watch
markdownTemplateEngine: 'njk',
};
};