-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
66 lines (52 loc) · 2.35 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
54
55
56
57
58
59
60
61
62
63
64
65
66
// Import 11ty nav plugin.
const eleventyNavigationPlugin = require( "@11ty/eleventy-navigation" );
// Import metagen plugin.
const metagen = require( "eleventy-plugin-metagen" );
// Import 11ty RSS plugin.
const eleventyRssPlugin = require("@11ty/eleventy-plugin-rss");
module.exports = function( eleventyConfig ) {
// Send assets from source to site.
eleventyConfig.addPassthroughCopy( {
"./source/_images/": "dist/images/",
"./source/_webfonts/": "dist/webfonts/"
} );
// Add the 11ty nav plugin.
eleventyConfig.addPlugin(eleventyNavigationPlugin);
// Add the metagen plugin.
eleventyConfig.addPlugin(metagen);
// Add the 11ty RSS plugin.
eleventyConfig.addPlugin(eleventyRssPlugin, {
posthtmlRenderOptions: {
quoteStyle: 0
}
});
eleventyConfig.addFilter( "getNewestCollectionItemDate", eleventyRssPlugin.getNewestCollectionItemDate );
eleventyConfig.addFilter( "dateToRfc822", eleventyRssPlugin.dateToRfc822 );
// Add blog glob.
eleventyConfig.addCollection( "blogPosts", require("./source/_config/collections/blog-posts.js") );
eleventyConfig.addCollection( "blogPostsFirst", require("./source/_config/collections/blog-posts-first.js") );
eleventyConfig.addCollection( "categories", require("./source/_config/collections/categories.js") );
eleventyConfig.addCollection( "categoryList", require("./source/_config/collections/category-list.js") );
eleventyConfig.addCollection( "tagList", require("./source/_config/collections/tag-list.js") );
// Add date filters.
eleventyConfig.addFilter( "simpleDate", require("./source/_config/filters/simple-date.js") );
eleventyConfig.addFilter( "shortDate", require("./source/_config/filters/short-date.js") );
eleventyConfig.addFilter( "longDate", require("./source/_config/filters/long-date.js") );
// Add year shortcode.
eleventyConfig.addShortcode( "year", require("./source/_config/shortcodes/year.js") );
// Add the image shortcode, from the 11ty image plugin.
eleventyConfig.addAsyncShortcode( "image", require("./source/_config/shortcodes/image.js") );
// Remove the console output of all generated files.
eleventyConfig.setQuietMode(true);
// 11ty config options.
return {
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
dir: {
input: "source",
data: "_data",
includes: "_includes",
output: "site"
},
};
};