forked from michelvanheest/shortcuts-design-data
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eleventy.js
41 lines (37 loc) · 1.46 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
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("assets/icons");
eleventyConfig.addPassthroughCopy("assets/fonts");
eleventyConfig.addPassthroughCopy("css");
eleventyConfig.addPassthroughCopy("js");
eleventyConfig.addPassthroughCopy("data");
eleventyConfig.addPassthroughCopy("docs");
eleventyConfig.addPassthroughCopy("_redirects");
eleventyConfig.addPassthroughCopy("shortcuts-design-social.jpg");
eleventyConfig.addPassthroughCopy("shortcuts-design-favicon.ico");
eleventyConfig.addPassthroughCopy("shortcuts-design-favicon.png");
eleventyConfig.addPassthroughCopy("sitemap.xml");
eleventyConfig.addCollection("tools", function(collection) {
return collection.getFilteredByGlob("tools/*.md").sort(function(a, b) {
let nameA = a.data.tool.toUpperCase();
let nameB = b.data.tool.toUpperCase();
if (nameA < nameB) return -1;
else if (nameA > nameB) return 1;
else return 0;
});
});
}
const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');
const imageminPngquant = require('imagemin-pngquant');
(async () => {
const files = await imagemin(['assets/img/*.{jpg,png}'], {
destination: '_site/assets/img',
plugins: [
imageminJpegtran(),
imageminPngquant({
quality: [0.7, 0.9]
})
]
});
console.log(files);
})();