-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
27 lines (25 loc) · 885 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
module.exports = function (eleventyConfig) {
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.addPassthroughCopy('meta');
eleventyConfig.addPassthroughCopy('opengraph');
eleventyConfig.addPassthroughCopy('fonts');
eleventyConfig.addPassthroughCopy('img');
eleventyConfig.addPassthroughCopy('css');
eleventyConfig.addFilter('website', str => {
const replaced = str
.replaceAll('a website', `<span>a website</span>`)
.replaceAll(' website ', ` <span>website</span> `)
.replaceAll(' website,', ` <span>website</span>,`)
.replaceAll(' site ', ` <span>site</span> `);
return replaced;
});
eleventyConfig.addFilter('toUTCString', str => {
return new Date(str).toUTCString();
})
eleventyConfig.addFilter('encodeURIComponent', str => {
return encodeURIComponent(str);
});
return {
htmlTemplateEngine: 'njk',
};
};