-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eleventy.js
65 lines (53 loc) · 1.72 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
const faviconsPlugin = require("eleventy-plugin-gen-favicons");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const addHash = require("./_11ty/helpers/addHash");
const readableDate = require("./_11ty/helpers/readableDate");
const minifyHTML = require("./_11ty/helpers/minifyHTML");
const siteConfig = require("./content/_data/siteConfig");
const minifyXML = require("./_11ty/helpers/minifyXML");
module.exports = function (eleventyConfig) {
// --- Copy assets
eleventyConfig.addPassthroughCopy({
assets: ".",
"assets/images": "images",
"assets/js": "js",
});
// --- Layout aliases
eleventyConfig.addLayoutAlias("base", "layouts/base.njk");
eleventyConfig.addLayoutAlias("index", "layouts/index.njk");
eleventyConfig.addLayoutAlias("page", "layouts/page.njk");
// --- Filters
eleventyConfig.addFilter("addHash", addHash);
eleventyConfig.addFilter("readableDate", readableDate);
eleventyConfig.addFilter(
"alwaysProductionUrl",
(path) => new URL(path, siteConfig.url)
);
// --- Plugins
eleventyConfig.addPlugin(faviconsPlugin, {
manifestData: {
name: siteConfig.title,
lang: siteConfig.language,
short_name: siteConfig.title,
description: siteConfig.description,
start_url: "/",
scope: "/",
display: "standalone",
theme_color: "#191818",
background_color: "#191818",
orientation: "any",
},
});
eleventyConfig.addPlugin(pluginRss);
// --- Transforms
eleventyConfig.addTransform("minifyHTML", minifyHTML);
eleventyConfig.addTransform("minifyXML", minifyXML);
return {
dir: {
input: "content",
},
templateFormats: ["md", "njk"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
};
};