-
Notifications
You must be signed in to change notification settings - Fork 39
/
eleventy.config.js
66 lines (57 loc) · 1.8 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
54
55
56
57
58
59
60
61
62
63
64
65
66
// plugins
import syntaxHighlightPlugin from "@11ty/eleventy-plugin-syntaxhighlight";
// collections
import { blogposts } from "./src/_11ty/collections/blogposts.js";
import { projects } from "./src/_11ty/collections/projects.js";
// filters
import { limit } from "./src/_11ty/filters/limit.js";
import {
dateFeed,
dateFormat,
dateFull,
dateISO,
dateYear,
} from "./src/_11ty/filters/dates.js";
import { json } from "./src/_11ty/filters/json.js";
export default function (eleventyConfig) {
// collections
eleventyConfig.addCollection("blogposts", blogposts);
eleventyConfig.addCollection("projects", projects);
// filters
eleventyConfig.addFilter("limit", limit);
eleventyConfig.addFilter("dateISO", dateISO);
eleventyConfig.addFilter("dateFeed", dateFeed);
eleventyConfig.addFilter("dateFull", dateFull);
eleventyConfig.addFilter("dateFormat", dateFormat);
eleventyConfig.addFilter("dateYear", dateYear);
eleventyConfig.addFilter("json", json);
// plugins
eleventyConfig.addPlugin(syntaxHighlightPlugin, {
trim: true,
});
// ignores
eleventyConfig.ignores.add("src/assets/**/*");
eleventyConfig.watchIgnores.add("src/assets/**/*");
// passthrough copy
eleventyConfig.setServerPassthroughCopyBehavior("copy");
eleventyConfig.addPassthroughCopy({ "./src/static": "/" });
eleventyConfig.addPassthroughCopy("./src/assets/img");
eleventyConfig.addPassthroughCopy("./src/assets/fonts");
// server config
eleventyConfig.setServerOptions({
watch: ["./dist/assets/css/**/*.css", "./dist/assets/js/**/*.js"],
port: 3000,
});
// base config
return {
dir: {
input: "src",
output: "dist",
includes: "_includes",
data: "_data",
},
templateFormats: ["njk", "md"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk",
};
}