-
Notifications
You must be signed in to change notification settings - Fork 0
/
eleventy.config.js
53 lines (52 loc) · 1.53 KB
/
eleventy.config.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
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import embeds from "eleventy-plugin-embed-everything"
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img"
import { DateTime } from "luxon";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
export default async function(eleventyConfig) {
eleventyConfig.addFilter("postDate", dateObj => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED)
})
eleventyConfig.addPassthroughCopy("src/img");
eleventyConfig.addPassthroughCopy("src/css");
eleventyConfig.addPassthroughCopy("src/favicon/");
eleventyConfig.addPassthroughCopy({ 'src/robots.txt': '/robots.txt' });
eleventyConfig.addPassthroughCopy({ 'src/CNAME': '/CNAME' });
eleventyConfig.addPlugin(embeds);
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPlugin(feedPlugin, {
type: "atom",
outputPath: "/feed.xml",
collection: {
name: "post",
limit: 25,
},
metadata: {
language: "en",
title: "Mijndert Stuij",
subtitle: "Senior DevOps Engineer. Runner. Minimalist.",
base: "https://mijndertstuij.nl/",
author: {
name: "Mijndert Stuij",
email: "mijndert@mijndertstuij.nl",
}
}
});
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
extensions: "html",
defaultAttributes: {
loading: "lazy",
decoding: "async",
sizes: "auto",
},
});
return {
markdownTemplateEngine: "njk",
dataTemplateEngine: "njk",
htmlTemplateEngine: "njk",
dir: {
input: "src",
output: "dist",
},
};
};