-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
39 lines (32 loc) · 1.14 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
const markdownIt = require("markdown-it");
const eleventySass = require("@11tyrocks/eleventy-plugin-sass-lightningcss");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
module.exports = function (eleventyConfig) {
const md = new markdownIt({
html: true,
});
eleventyConfig.addFilter("extractYear", function (value) {
const date = new Date(value);
return date.getFullYear(); // Returns the year part of the date
});
eleventyConfig.addCollection("projects", function (collectionApi) {
return collectionApi.getFilteredByGlob("/projects/*.md");
});
eleventyConfig.addPairedShortcode("markdown", (content) => {
return md.render(content);
});
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(eleventySass);
eleventyConfig.addPassthroughCopy("CNAME");
eleventyConfig.addPassthroughCopy("src/assets");
// eleventyConfig.addPassthroughCopy("src/assets/img");
// eleventyConfig.addPassthroughCopy("src/assets/js");
// eleventyConfig.addPassthroughCopy("src/assets/fonts");
return {
dir: {
data: "_data",
input: "src",
output: "dist",
},
};
};