This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
55 lines (48 loc) · 1.7 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
const pluginWebc = require("@11ty/eleventy-plugin-webc");
const { DateTime } = require('luxon')
const { formatTimeString } = require('./formatTime')
const filesMinifier = require("@sherby/eleventy-plugin-files-minifier");
const downloader = require('11ty-external-file-downloader');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginWebc, {
components: [
"./src/_components/**/*.webc"
]
});
eleventyConfig.addPlugin(filesMinifier);
eleventyConfig.addPlugin(downloader, {
urls: [
'https://analytics.zacharyc.site/analytics.js'
],
directory: 'public'
});
eleventyConfig.addWatchTarget("./src/css/");
eleventyConfig.addWatchTarget("./src/js/");
eleventyConfig.addPassthroughCopy("src/fonts")
eleventyConfig.addPassthroughCopy("src/icons")
eleventyConfig.addPassthroughCopy("src/_redirects")
eleventyConfig.addPassthroughCopy("src/coloris.min.css")
eleventyConfig.addPassthroughCopy("src/coloris.min.js")
eleventyConfig.addPassthroughCopy("src/favicon.ico")
eleventyConfig.addPassthroughCopy("src/google9280d1828cb7dc65.html")
eleventyConfig.addPassthroughCopy("src/manifest.json")
eleventyConfig.addPassthroughCopy("src/robots.txt")
eleventyConfig.addPassthroughCopy("src/sitemap.xml")
eleventyConfig.addFilter('stringify', function (obj) {
return JSON.stringify(obj);
});
eleventyConfig.addFilter('formatDate', function (date) {
date = DateTime.fromFormat(date, 'MM/dd/yyyy')
return date.toFormat('M/dd/yyyy')
});
eleventyConfig.addFilter('formatTime', function (time) {
return formatTimeString(time)
});
return {
dir: {
input: "src",
output: "public"
},
templateFormats: ["njk", "webc", "md"],
};
}