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 = [
2121 'cloudinary' ,
2222 'contentful' ,
2323 'directus' ,
24+ 'edgio' ,
2425 'fastly' ,
2526 'filerobot' ,
2627 'glide' ,
@@ -31,6 +32,7 @@ const BuiltInProviders = [
3132 'imgix' ,
3233 'ipx' ,
3334 'ipxStatic' ,
35+ 'layer0' ,
3436 'netlify' ,
3537 'netlifyLargeMedia' ,
3638 '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 {
110110 gumlet ?: any
111111 imagekit ?: any
112112 imgix ?: any
113+ layer0 ?: any
114+ edgio ?: any
113115 prismic ?: any
114116 twicpics ?: any
115117 storyblok ?: any
You can’t perform that action at this time.
0 commit comments