forked from lodash/lodash.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
icons.js
70 lines (67 loc) · 1.51 KB
/
icons.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
65
66
67
68
69
70
'use strict'
const _ = require('lodash')
const fs = require('fs')
const path = require('path')
const manifest = JSON.parse(fs.readFileSync('./_site/manifest.webmanifest', 'utf8'))
/*----------------------------------------------------------------------------*/
module.exports = {
'assets/img/lodash.svg': _(manifest.icons)
.reject(['sizes', 'any'])
.map(icon => {
const sizes = icon.sizes.split('x')
return {
'rename': path.basename(icon.src),
'width': +sizes[0],
'height': +sizes[1],
'background': 'rgba(0,0,0,0)'
}
})
.push(
{
'rename': 'apple-touch-180x180.png',
'width': 180,
'height': 180,
'flatten': true
},
{
'rename': 'mstile-150x150.png',
'width': 150,
'height': 150,
'flatten': true
},
{
'rename': 'mstile-310x150.png',
'width': 310,
'height': 150,
'embed': true,
'flatten': true
},
{
'rename': 'mstile-310x310.png',
'width': 310,
'height': 310,
'flatten': true
}
)
.value(),
'icons/favicon-16x16.png': [
{
'rename': 'favicon-16x16.png',
'width': 16,
'height': 16,
'interpolator': 'nearest'
},
{
'rename': 'favicon-32x32.png',
'width': 32,
'height': 32,
'interpolator': 'nearest'
},
{
'rename': 'favicon-48x48.png',
'width': 48,
'height': 48,
'interpolator': 'nearest'
}
]
}