generated from 5t3ph/11ty-sass-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eleventy.js
55 lines (48 loc) · 1.79 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
// Import filters
const {
displayDateFilter,
isoDateFilter,
isRecentDate,
} = require("./src/_filters/date-filters.js");
const { onlyToC, noToC } = require("./src/_filters/toc-filters.js");
const readingTime = require("./src/_filters/reading-time.js");
const {
markdownFilter,
markdownLib,
} = require("./src/_filters/markdown-filter.js");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const footnotes = require("eleventy-plugin-footnotes");
const externalLinks = require("@aloskutov/eleventy-plugin-external-links");
module.exports = function (eleventyConfig) {
eleventyConfig.setDataDeepMerge(true);
eleventyConfig.addWatchTarget("./src/_sass/");
// add JS file
eleventyConfig.addPassthroughCopy({ "./src/_js/": "/js" });
// Copy `img/favicon/` to `public/`
eleventyConfig.addPassthroughCopy({ "./src/_img/favicon": "/" });
// Copy `img/og/` to `public/`
eleventyConfig.addPassthroughCopy({ "./src/_img/og": "/" });
eleventyConfig.addPassthroughCopy({ "./src/_img/articles": "/img/articles" });
eleventyConfig.addPlugin(footnotes);
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(externalLinks, {
url: "https://federal-field-notes.ca",
rel: ["noopener", "external"],
});
// Filters
eleventyConfig.addFilter("markdownFilter", markdownFilter);
eleventyConfig.addFilter("displayDateFilter", displayDateFilter);
eleventyConfig.addFilter("isoDateFilter", isoDateFilter);
eleventyConfig.addFilter("isRecentDate", isRecentDate);
eleventyConfig.addFilter("onlyToC", onlyToC);
eleventyConfig.addFilter("noToC", noToC);
eleventyConfig.addFilter("readingTime", readingTime);
// replace the default markdown-it instance
eleventyConfig.setLibrary("md", markdownLib);
return {
dir: {
input: "src",
output: "public",
},
};
};