Skip to content

Resize images in the WebFlow CMS based on predefined size in help field

Notifications You must be signed in to change notification settings

expertlead/webflow-image-resizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webflow-image-resizer

Build Status

about

Resize images in the WebFlow CMS based on predefined size in your collection image help fields. Format for help field sizing "300x300" supports 1 - 4 digit numbers (see example picture below).

Images will be scaled down to fit the smallest constraint, with priority given to width. For example stating with an image 1300x860 and help text of 400x400, the result would be an image of 400x265.

Image fields without help text or images that already meet the sizing requirements will be ignored by image-resizer.

size-example

How to install

$ npm i --save webflow-image-resizer

Required env variables

In order to be able to persist the exported images in S3, you have to export these env variables:

  • AWS_ACCESS_KEY_ID Access key ID
  • AWS_SECRET_ACCESS_KEY Secret access key

How to use

var WebflowImageResizer = require('webflow-image-resizer')
var resizer = new WebflowImageResizer(
    {
        aws: {
            region: 'eu-west-1',
            bucket: 'examplebucket'
        },
        webflow: {
            token: 'example-webflow-token'
        }
    }
);

resizer.onResizeSite('yourSiteIdHere')

About

Resize images in the WebFlow CMS based on predefined size in help field

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published