-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
49 lines (44 loc) · 3.2 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
module.exports = function(eleventyConfig) {
const { addHours, format, formatISO, formatRFC7231 } = require('date-fns');
const boardGameListShortCode = require('./_includes/shortcodes/boardgamelist-shortcode.js');
const bookListShortCode = require('./_includes/shortcodes/booklist-shortcode.js');
const cdnImageShortCode = require('./_includes/shortcodes/cdnimage-shortcode.js');
const episodeCardShortCode = require('./_includes/shortcodes/episodecard-shortcode.js');
const episodeBlockShortCode = require('./_includes/shortcodes/episodeblock-shortcode.js');
const episodeInlineShortCode = require('./_includes/shortcodes/episodeinline-shortcode.js');
const iconShortCode = require('./_includes/shortcodes/icon-shortcode.js');
const listShortCode = require('./_includes/shortcodes/list-shortcode.js');
const linkListShortCode = require('./_includes/shortcodes/linklist-shortcode.js');
const movieShortCode = require('./_includes/shortcodes/movie-shortcode.js');
const movieListShortCode = require('./_includes/shortcodes/movielist-shortcode.js');
const siteHeaderShortCode = require('./_includes/shortcodes/siteheader-shortcode.js');
const youtubeShortCode = require('./_includes/shortcodes/youtube-shortcode.js');
const youtubeListShortCode = require('./_includes/shortcodes/youtubelist-shortcode.js');
eleventyConfig.addFilter("getProperty", (object, property) => object[property]);
eleventyConfig.addFilter("machineDate", dateObject => formatISO(dateObject, { representation: "date" }));
eleventyConfig.addFilter("readableDate", dateObject => format(dateObject, "MMMM do, yyyy"));
eleventyConfig.addFilter("rssDate", dateObject => formatRFC7231(dateObject));
eleventyConfig.addFilter("rssTags", tags => tags.filter(tag => !['episodes'].includes(tag)));
eleventyConfig.addFilter("setEpisodeReleaseTime", dateObject => addHours(dateObject, 20));
eleventyConfig.addFilter("year", dateObject => format(dateObject, 'yyyy'));
eleventyConfig.addLayoutAlias('episode', 'layouts/episode.njk');
eleventyConfig.addLayoutAlias('home', 'layouts/home.njk');
eleventyConfig.addLayoutAlias('site', 'layouts/site.njk');
eleventyConfig.addShortcode("boardGameList", boardGameListShortCode);
eleventyConfig.addShortcode("bookList", bookListShortCode);
eleventyConfig.addShortcode("cdnImage", cdnImageShortCode);
eleventyConfig.addShortcode("episodeCard", episodeCardShortCode);
eleventyConfig.addShortcode("episodeBlock", episodeBlockShortCode);
eleventyConfig.addShortcode("episodeInline", episodeInlineShortCode);
eleventyConfig.addShortcode("icon", iconShortCode);
eleventyConfig.addShortcode("list", listShortCode);
eleventyConfig.addShortcode("linkList", linkListShortCode);
eleventyConfig.addShortcode("movie", movieShortCode);
eleventyConfig.addShortcode("movieList", movieListShortCode);
eleventyConfig.addShortcode("siteHeader", siteHeaderShortCode);
eleventyConfig.addShortcode("youtube", youtubeShortCode);
eleventyConfig.addShortcode("youtubeList", youtubeListShortCode);
eleventyConfig.addPassthroughCopy("css");
eleventyConfig.addPassthroughCopy("js");
eleventyConfig.addPassthroughCopy("img");
};