-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eleventy.js
48 lines (38 loc) · 1.32 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
const path = require("path");
const pluginRss = require("@11ty/eleventy-plugin-rss");
// const searchFilter = require("./app/utils/searchFilter.js");
module.exports = (eleventyConfig) => {
// Plugins
eleventyConfig.addPlugin(pluginRss);
// TODO: Add Search Filter
// eleventyConfig.addFilter("search", searchFilter);
// Add Shortcodes
// Get the current year - super useful for copyright dates.
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
// Template formats
eleventyConfig.setTemplateFormats(["md", "njk", "html"]);
// Copy favicons & images
eleventyConfig.addPassthroughCopy({ "app/web/ico": "ico" });
eleventyConfig.addPassthroughCopy({ "app/web/img": "img" });
// Tell 11ty to use the .eleventyignore and ignore our .gitignore file
eleventyConfig.setUseGitIgnore(false);
// Add delay before re-running
eleventyConfig.setWatchThrottleWaitTime(500); // in milliseconds
// dev server
eleventyConfig.setServerOptions({
watch: [
path.resolve(__dirname, "public/js/**/*.js"),
path.resolve(__dirname, "public/css/**/*.css"),
],
showVersion: true,
});
// You can return your Config object (optional).
return {
dir: {
input: "app/web",
output: "public",
},
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
};
};