-
Notifications
You must be signed in to change notification settings - Fork 28
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
Make the Plugin Support Cloudinary Assets Sourced Via CMSs #245
Comments
@olavea I was looking to take up this one but can you explain a little bit more about the requirements of this issue? |
Hey @partik03 The current solution lets you define types that should get the gatsbyImageData resolver added. However it requires the data on the type to conform to a very specific shape. The new solution should let the user of the plugin configure where on the type to find the data it needs. module.exports = {
plugins: [
{
resolve: `gatsby-transformer-cloudinary`,
options: {
// Add the `gatsbyImageData` resolver to `BlogPostHeroImage`
transformTypes: [
`BlogPostHeroImage`,
{
type: `SanityCloudinaryAsset`,
cloudName: () => `example-cloud`, // Manually configure the cloud name by returning it from a function
publicId: (data) => data.public_id, // Use the value of public_id from SanityCloudinaryAsset
originalHeight: `height`, // Convenience alternative to the above by defining the path on SanityCloudinaryAsset where height can be found
originalWidth: `width`,
originalFormat: `format`
}
],
// Optional transformation option
defaultTransformations: ['c_fill', 'g_auto', 'q_auto'],
},
},
`gatsby-plugin-image`,
],
}; I apologize for the late reply. Any follow up questions from you would be welcome 😺 👍 |
We are looking to make the plugin seamlessly support Cloudinary assets sourced via CMSs and other sources.
Code this similarly to gatsby-remote-images: config docs link
The text was updated successfully, but these errors were encountered: