Comments (2)
@olavea I was looking to take up this one but can you explain a little bit more about the requirements of this issue?
from gatsby-transformer-cloudinary.
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.
The feature might easiest be explained by how the configuration should look when done. For a Cloudinary image in Sanity the gatsby-config.js of the user should look like:
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 😺 👍
from gatsby-transformer-cloudinary.
Related Issues (20)
- Bundling External Files in a Gatsby v4 compatible way HOT 1
- ERROR Type with name "RemoteFileResize" does not exists HOT 4
- Add contributing docs, license and code of conduct HOT 1
- Validate configured options using `pluginOptionsSchema` HOT 1
- Add automated test and release process using Semantic Release HOT 2
- Remove support for deprecated gatsby-image HOT 2
- Rework README.md HOT 1
- Rework demo HOT 3
- `gatsbyImageData` generates `http` urls, not `https` HOT 2
- Error [ValidationError]: "error" must be of type object HOT 10
- Gatsby v5 support HOT 2
- TypeError: Cannot read properties of undefined (reading 'width') HOT 4
- Add custom analytics code for generated Cloudinary URLs HOT 5
- Cannot query gatsbyImageData via Cloudinary app on Contentful HOT 7
- warning [gatsby-transformer-cloudinary] No metadata for ... gatsbyImageData will resolve to null HOT 4
- How to upload local image to Cloudinary during Gatsby build
- Make the Contributing.md hacktoberfest ready HOT 7
- Rewrite README to explain how to add Gatsby image support to Cloudinary image data sourced from Sanity CMS HOT 2
- Support for cname (secure distribution) and private cdn
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-transformer-cloudinary.