-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
34 lines (26 loc) · 1.01 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
const { DateTime } = require('luxon');
module.exports = function (eleventyConfig) {
// Put robots.txt in root
eleventyConfig.addPassthroughCopy({ 'src/robots.txt': '/robots.txt' });
eleventyConfig.addPassthroughCopy({ 'src/styles.css': '/css/styles.css' });
eleventyConfig.addPassthroughCopy({ 'src/js/app.js': '/js/app.js' });
eleventyConfig.addPassthroughCopy({ 'src/js/search.js': '/js/search.js' });
eleventyConfig.addPassthroughCopy({ 'src/assets': '/assets' });
// Convert gmt date to locale string
eleventyConfig.addFilter('postDate', (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED)
});
// Display year
eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`);
// Input directory: src
// Output directory: dist
return {
dir: {
input: "src",
output: "dist",
layouts: 'includes/layouts',
includes: "includes",
data: "data",
}
}
};