-
Notifications
You must be signed in to change notification settings - Fork 1
/
config-liip-pictures.js
74 lines (70 loc) · 1.61 KB
/
config-liip-pictures.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
71
72
73
74
import rokkaHelper from './src/rokkaHelper';
const glitchit = {
title: 'Glitch it',
url: function (icon, rokkaOrg) {
return `https://glitch.liip.to/?hash=${icon.short_hash}&org=${rokkaOrg}`;
},
};
const maxwidth = {
title: function (icon) {
if (icon.width > 1920) {
return 'Open with 1920px width';
}
if (icon.width > 728) {
return 'Open with 728px width';
}
return null;
},
url: function (icon, rokkaOrg) {
let width = 728;
if (icon.width > 1920) {
width = 1920;
}
return rokkaHelper.renderUrl(
icon,
rokkaOrg,
width,
null,
null,
'dynamic/resize-width-${width}-upscale-false'
);
},
};
export default {
rokkaOrg: 'liip-pictures',
rokkaKey: '${LIIP_PICTURES_ROKKA_KEY}',
orgOptions: {
'liip-pictures': {
deleteEnabled: true,
downloads: {
original: {
title: 'Download original',
url: function (icon, rokkaOrg) {
return rokkaHelper.renderUrl(
icon,
rokkaOrg,
null,
null,
null,
'raw/o-content_disposition-attachment'
);
},
},
maxwidth2: {
title: 'Download with 1920px width',
url: function (icon, rokkaOrg) {
return rokkaHelper.renderUrl(
icon,
rokkaOrg,
'1920',
null,
null,
'dynamic/resize-width-${width}-upscale-false/o-af-0-content_disposition-attachment'
);
},
},
maxwidth,
},
},
},
};