Closed ascorbic closed 3 years ago
Awesome, thanks @ascorbic! I'll add some tests and let you know how it goes :)
Alright, seems everything is working, released in v2.6.0. Thanks for your PR!
I would not suggest giving fm: "jpeg"
in the README example, as we try to use auto format.
Agreed!
This PR adds support for the exciting new gatsby-plugin-image, by adding a new
gatsbyImageData
alongside the oldfixed
andfluid
resolvers, which are now deprecated.The query syntax no longer uses fragments, but instead uses arguments passed to the resolver:
The imgixParams are the same as the old resolvers. There are additionally arguments that match ones used in the core gatsby plugin:
layout
,width
,height
,aspectRatio
,backgroundColor
. Theplaceholder
argument is the same as before, but adds a newDOMINANT_COLOR
option, which uses the value from theimage.colors
array. This is the default, and has the benefit of not needing to download anything at build time. The menaings of the other options, such as the different layout types, can be seen in the plugin reference guide.This adds
gatsby-plugin-image
as a peer dependency, and the docs need to be updated to tell users to install the plugin.If you are happy with the PR I can add updates to the docs as well.