-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
40 lines (34 loc) · 1002 Bytes
/
.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
import shikiPlugin from "./libs/shiki.js";
export default async (eleventyConfig) => {
eleventyConfig.addPlugin(shikiPlugin, {
themes: ["dark-plus"],
langs: ['html', 'css', 'javascript', 'typescript', 'vue']
});
eleventyConfig.addPassthroughCopy("src/assets");
eleventyConfig.addFilter("sortByDate", (items) => {
return items.sort((a, b) => {
let dateANumeric = new Date(a.date);
let dateBNumeric = new Date(b.date);
return dateBNumeric - dateANumeric;
});
});
eleventyConfig.addFilter('dateFilter', function(date) {
return new Date(date).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
});
eleventyConfig.addFilter("filterWIP", (items) => {
return items.filter(item => !item.data.wip && !item.data.WIP);
})
return {
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
input: "src",
output: "public"
},
}
}