netlify-plugin-cloudinary
netlify-plugin-cloudinary copied to clipboard
Support Automated Image Scaling with Client Hints
Description
The following changes allow users to follow the suggestions outlined in How to Scale an Image Automatically using Client Hints, specifically:
- Scaling an image's width automatically (e.g. 100vw returns an image that is the same width as the viewport)
- Avoiding cache misses through advanced usage, which allows users to determine the "jumps" between image resource sizes
Changes made:
- Accept string or number Inputs for maxSize.height and maxSize.width via netlify.toml
- Accept string Inputs for maxSize.crop via netlify.toml
Issue Ticket Number
Fixes https://github.com/cloudinary-community/netlify-plugin-cloudinary/issues/104
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Checklist
- [X] I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
- [X] I have created an issue ticket for this PR
- [X] I have checked to ensure there aren't other open Pull Requests for the same update/change?
- [X] I have performed a self-review of my own code
- [x] I have run tests locally to ensure they all pass
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes needed to the documentation