-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
31 lines (30 loc) · 892 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
const mathjaxPlugin = require('eleventy-plugin-mathjax');
module.exports = (config) => {
config.addFilter('prettyDate', (date) => {
const UTCString = date.toUTCString();
return UTCString.slice(0, UTCString.indexOf(' 00:'));
});
config.addFilter('dateTime', (date) => {
return date.toISOString().split('T')[0];
});
config.addFilter('kebab', (str) => {
const regex = /\/|_/gm;
return str.replaceAll(regex, '-');
});
config.addPassthroughCopy('src/assets/css');
config.addPassthroughCopy('src/assets/images');
config.addPassthroughCopy('src/assets/favicon');
config.addPassthroughCopy('_headers');
config.addPlugin(mathjaxPlugin, {
output: 'svg',
});
config.addWatchTarget('./src/assets/css/');
return {
markdownTemplateEngine: 'njk',
dir: {
input: 'src',
output: 'public',
passthroughFileCopy: true,
},
};
};