Postleaf / postleaf

Simple, beautiful publishing with Node.js.
https://www.postleaf.org/
MIT License
505 stars 204 forks source link

maxWidth for dynamic images // feature request #102

Closed M8inC closed 5 years ago

M8inC commented 5 years ago

Dynamic Images is a great feature! But i would like to define a maximum image width, because my (your ;) ) theme/template has a maximum content-image-width of 875px. So it is not required to load an image wider than that size.

I solved it for myself by changing line 87 in file /source/modules/dynamic_images.js from for(let width = 200; width < upload.width; width += 200) { to for(let width = 200; width < 801; width += 200) {

but it would be cool if this could be done from the admin settings or in theme.json. As far as i can see does this change has no impact on other functions.

Best Regards, Martin

claviska commented 5 years ago

Added in #106. I'd love a PR that documents how to set this in .env 👍