-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eleventy.js
64 lines (56 loc) · 1.87 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const {
calcWorkingPeriod,
getPassedYears,
capitalize,
calcTotalWorkingPeriod
} = require('./utils');
module.exports = function(config) {
config.addPassthroughCopy('src/web_page/css');
config.addPassthroughCopy('src/web_page/fonts');
config.addPassthroughCopy('src/web_page/scripts');
config.addPassthroughCopy('src/web_page/styles');
config.addPassthroughCopy('src/web_page/images');
config.addPassthroughCopy('src/web_page/site.webmanifest');
config.addPassthroughCopy('src/web_page/cv.pdf');
config.addFilter('passedYears', getPassedYears);
config.addFilter('workingPeriod', calcWorkingPeriod);
config.addFilter('totalWorkingPeriod', calcTotalWorkingPeriod);
config.addFilter('capitalize', capitalize);
config.addTransform('htmlmin', (content, outputPath) => {
if(outputPath && outputPath.endsWith('.html')) {
const htmlmin = require('html-minifier');
return htmlmin.minify(
content,
{
removeComments: true,
collapseWhitespace: true
}
);
}
return content;
});
config.addTransform('uglify-js', (content, outputPath) => {
if(outputPath && outputPath.endsWith('.js')) {
const uglify = require('uglify-js');
return uglify.minify(content);
}
return content;
});
config.addPlugin(require("eleventy-plugin-svg-contents"));
return {
dir: {
input: 'src/web_page',
output: 'dist',
includes: 'includes',
layouts: 'layouts',
data: "../data"
},
dataTemplateEngine: 'njk',
markdownTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
passthroughFileCopy: false,
templateFormats: [
'md', 'njk'
]
};
};