forked from reeseschultz/11r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
47 lines (39 loc) · 1.18 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
const siteSettings = require('./src/globals/site.json');
const markdownIt = new require('markdown-it')({
typographer: true,
linkify: true
});
// Tables of contents in Markdown files
const pluginTOC = require('eleventy-plugin-toc');
const markdownItAnchor = require('markdown-it-anchor');
markdownIt.use(markdownItAnchor);
module.exports = (config) => {
config.setLibrary('md', markdownIt);
config.addPlugin(pluginTOC, {
tags: ['h3', 'h4', 'h5']
});
config.addPlugin(require('@11ty/eleventy-plugin-syntaxhighlight'));
config.addPlugin(require("@11ty/eleventy-plugin-rss"));
config.addFilter('dateDisplay', require('./filters/date-display.js'));
config.addPassthroughCopy({ public: './' });
config.setBrowserSyncConfig({
files: ['dist/**/*'],
open: true,
});
config.setDataDeepMerge(true);
config.addCollection('postsWithoutDrafts', (collection) =>
[...collection.getFilteredByGlob('src/posts/*.md')].filter(
(post) => !post.data.draft
)
);
return {
pathPrefix: siteSettings.baseUrl,
dir: {
input: 'src',
output: 'dist',
includes: 'includes',
layouts: 'includes/layouts',
data: 'globals',
},
};
};