-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path.eleventy.js
43 lines (41 loc) · 1.4 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
const pluginBookshop = require("@bookshop/eleventy-bookshop");
const { DateTime } = require("luxon");
const emojiReadTime = require("@11tyrocks/eleventy-plugin-emoji-readtime");
const { wordCountCallback } = require("./site/js/wordCount");
const MarkdownIt = require("markdown-it"),
md = new MarkdownIt({
html: true,
});
module.exports = function (eleventyConfig) {
eleventyConfig.addFilter("length", (input) => {
return input.length;
});
eleventyConfig.addFilter("postDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED);
});
eleventyConfig.addPlugin(emojiReadTime, {
showEmoji: false,
});
eleventyConfig.addFilter("wordCount", wordCountCallback);
eleventyConfig.addFilter("markdownify", (markdown) => md.render(markdown));
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
eleventyConfig.htmlTemplateEngine = "liquid";
eleventyConfig.addPlugin(
pluginBookshop({
bookshopLocations: ["component-library"],
pathPrefix: "",
})
);
eleventyConfig.ignores.add("site/schemas");
eleventyConfig.addPassthroughCopy("site/css");
eleventyConfig.addPassthroughCopy("site/fonts");
eleventyConfig.addPassthroughCopy("site/images");
eleventyConfig.addPassthroughCopy("site/js");
eleventyConfig.addPassthroughCopy("site/vendor");
return {
dir: {
input: "site",
pages: "pages",
},
};
};