generated from CodeStitchOfficial/Intermediate-Website-Kit-LESS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
31 lines (27 loc) · 1.25 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
// imports
const eleventyNavigationPlugin = require('@11ty/eleventy-navigation');
const { DateTime } = require('luxon');
module.exports = function (eleventyConfig) {
// adds the official eleventy navigation plugin for a scalable navigation
eleventyConfig.addPlugin(eleventyNavigationPlugin);
// allows assets, CMS files and other root files to be passed into /public. styles are automatically generated by LESS/SASS
eleventyConfig.addPassthroughCopy('./src/assets');
eleventyConfig.addPassthroughCopy('./src/admin');
eleventyConfig.addPassthroughCopy('./src/_redirects');
eleventyConfig.addPassthroughCopy({ './src/robots.txt': '/robots.txt' });
eleventyConfig.addPassthroughCopy({ './src/sitemap.xml': '/sitemap.xml' });
// normally, 11ty will render dates on blog posts in full JSDate format (Fri Dec 02 18:00:00 GMT-0600)
// this filter allows dates to be converted into a normal, locale format. view the docs to learn more (https://moment.github.io/luxon/api-docs/index.html#datetime)
eleventyConfig.addFilter('postDate', (dateObj) => {
return DateTime.fromJSDate(dateObj).toLocaleString(DateTime.DATE_MED);
});
return {
dir: {
input: 'src',
output: 'public',
includes: '_includes',
data: '_data',
},
htmlTemplateEngine: 'njk',
};
};