-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheleventy.config.js
More file actions
101 lines (86 loc) · 3.09 KB
/
eleventy.config.js
File metadata and controls
101 lines (86 loc) · 3.09 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* 11ty plugins.
*/
import eleventyNavigationPlugin from '@11ty/eleventy-navigation';
import { feedPlugin } from '@11ty/eleventy-plugin-rss';
import favicons from 'eleventy-plugin-gen-favicons';
import markdownIt from 'markdown-it';
import markdownItAttrs from 'markdown-it-attrs';
import metagen from 'eleventy-plugin-metagen';
import collectionPostList from './source/_config/collections/posts.js';
import collectionTagList from './source/_config/collections/tags.js';
import filterDate from './source/_config/filters/date-simple.js';
/*
* 11ty configurations.
* This section includes setup for collections, filters, and shortcodes.
*/
export default async function (eleventyConfig) {
// Add the 11ty nav plugin. This creates an 11ty navigation based on pages
// in a collection.
eleventyConfig.addPlugin(eleventyNavigationPlugin);
// Add the 11ty RSS plugin. This creates a feed that can then be available
// for audience to subscribe to the blog in their favorite reader.
eleventyConfig.addPlugin(feedPlugin, {
collection: {
name: 'posts',
},
metadata: {
language: 'en',
title: 'Reed Piernock',
subtitle:
'Reed is a front-end developer and pop culture scholar. Their blog covers a variety of topics, from HTML to horror movies.',
base: 'https://reedcodes.com/',
author: {
name: 'Reed Piernock',
},
},
});
// Add the metagen plugin for 11ty.
// https://github.com/tannerdolby/eleventy-plugin-metagen
eleventyConfig.addPlugin(metagen);
// Add the MarkdownIt plugin for 11ty.
eleventyConfig.setLibrary(
'md',
markdownIt({
html: true,
breaks: true,
linkify: true,
}).use(markdownItAttrs)
);
// Add the favicon plugin for 11ty.
// https://github.com/NJAldwin/eleventy-plugin-gen-favicons
eleventyConfig.addPlugin(favicons, {
outputDir: './site',
});
// Add collections! This assists in pulling in various collections in the
// blog, such as posts and tags.
eleventyConfig.addPlugin(collectionPostList);
eleventyConfig.addPlugin(collectionTagList);
// Add date filters to make it a little easier to write dates.
eleventyConfig.addPlugin(filterDate);
// Watch for changes to assets, such as images or style sheets, and refresh
// the website.
eleventyConfig.addWatchTarget('./source/_scss/**/*.scss');
// Send any static assets in the source directory to the built site.
eleventyConfig.addPassthroughCopy({
'./source/_images/': '_assets/images/',
'./source/_webfonts/': '_assets/webfonts/'
});
}
export const config = {
templateFormats: ['njk', 'md', 'html'],
htmlTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
// These are the folders that 11ty will use when compiling the built site.
// The directories for `input` and `output` are relative to the root of the
// project. The directories for `data`, `includes`, and `layouts` are
// relative to the `input` directory, i.e. `source`.
dir: {
input: 'source',
data: '_data',
includes: '_includes',
layouts: '_layouts',
output: 'site',
},
};