File tree Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const BuiltInProviders = [
21
21
'cloudinary' ,
22
22
'contentful' ,
23
23
'directus' ,
24
+ 'edgio' ,
24
25
'fastly' ,
25
26
'filerobot' ,
26
27
'glide' ,
@@ -31,6 +32,7 @@ const BuiltInProviders = [
31
32
'imgix' ,
32
33
'ipx' ,
33
34
'ipxStatic' ,
35
+ 'layer0' ,
34
36
'netlify' ,
35
37
'netlifyLargeMedia' ,
36
38
'netlifyImageCdn' ,
Original file line number Diff line number Diff line change
1
+ import { joinURL } from 'ufo'
2
+ import type { ProviderGetImage } from '../../module'
3
+ import { createOperationsGenerator } from '#image'
4
+
5
+ const operationsGenerator = createOperationsGenerator ( {
6
+ keyMap : {
7
+ height : 'height' ,
8
+ quality : 'quality' ,
9
+ width : 'width' ,
10
+ } ,
11
+ joinWith : '&' ,
12
+ formatter : ( key , value ) => String ( value ) === 'true' ? key : `${ key } =${ value } ` ,
13
+ } )
14
+
15
+ export const getImage : ProviderGetImage = ( src , {
16
+ modifiers = { } ,
17
+ baseURL = 'https://opt.moovweb.net' ,
18
+ } = { } ) => {
19
+ const operations = operationsGenerator ( modifiers )
20
+
21
+ return {
22
+ url : joinURL ( baseURL , '?img=' + src + ( operations ? ( '&' + operations ) : '' ) ) ,
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ export * from './edgio'
Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ export interface ImageProviders {
110
110
gumlet ?: any
111
111
imagekit ?: any
112
112
imgix ?: any
113
+ layer0 ?: any
114
+ edgio ?: any
113
115
prismic ?: any
114
116
twicpics ?: any
115
117
storyblok ?: any
You can’t perform that action at this time.
0 commit comments