-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(image_services): Add mention of new validateOptions hook #2859
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @Princesseuh! 🎉
Could we add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! But I do agree with @Jutanium here, might be helpful to have an example.
Core PR has been merged, will merge this when it's released |
Merging-on-release, but we have an example ready to add in a separate PR. |
What kind of changes does this PR include?
Description
withastro/astro#6555 adds a new hook to the Image Service API that can be used to validate and augment the passed options. The built-in services uses this hook to set the default format as
webp
if the user hasn't passed a format, for example.It takes the same
options
as the other hooks, so anImageTransform
and it returns an ImageTransform as well. Returning anImageTransform
is mandatory, so the implementation should probably always end withreturn options;
This PR additionally contain some misc fix to the rest of the file