-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
35 lines (34 loc) · 1.48 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
const { DateTime } = require("luxon")
const rssPlugin = require("@11ty/eleventy-plugin-rss")
const sortByDisplayOrder = require("./src/utils/sort-by-display-order.js")
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("./src/css");
eleventyConfig.addPassthroughCopy("./src/robots.txt");
eleventyConfig.addPassthroughCopy("./src/feed.xsl");
eleventyConfig.addCollection('writing', collection => {
return [...collection.getFilteredByGlob('./src/writing/*.md')].reverse()
})
eleventyConfig.addCollection('projects', collection => {
return sortByDisplayOrder(collection.getFilteredByGlob('/src/projects/*.md'))
})
// eleventyConfig.addCollection('featuredProjects', collection => {
// return sortByDisplayOrder(collection.getFilteredByGlob('./src/projects/*.md')).filter(x => x.data.featured)
// })
// eleventyConfig.addCollection('featuredWriting', collection => {
// return sortByDisplayOrder(collection.getFilteredByGlob('./src/writing/*.md')).filter(x => x.data.featured)
// })
eleventyConfig.addFilter('asPostDate', (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_FULL)
})
eleventyConfig.addPlugin(rssPlugin)
return {
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
passthroughFileCopy: true,
dir: {
input: "src",
output: "_site"
}
}
}