-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
31 lines (23 loc) · 908 Bytes
/
.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
require('dotenv').config();
const { documentToHtmlString } = require("@contentful/rich-text-html-renderer");
const { DateTime } = require("luxon");
const faviconsPlugin = require("eleventy-plugin-gen-favicons");
module.exports = function (eleventyConfig) {
// Watch CSS files for changes
eleventyConfig.setBrowserSyncConfig({
files: './_site/css/**/*.css'
});
eleventyConfig.addFilter("renderRichTextAsHtml", (value) =>
documentToHtmlString(value)
);
eleventyConfig.addFilter("postDate", dateObj => {
return DateTime.fromISO(dateObj, {zone: 'utc'}).toFormat("LLL dd, yyyy");
});
eleventyConfig.addPassthroughCopy("bundle.js");
// eleventyConfig.addPassthroughCopy({ "img/favicon": "/" });
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPlugin(faviconsPlugin, {});
return {
passthroughFileCopy: true
};
};