Skip to content
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

Easy way to access original cloudinay image url? #5

Open
andre-brdoch opened this issue Oct 30, 2020 · 2 comments
Open

Easy way to access original cloudinay image url? #5

andre-brdoch opened this issue Oct 30, 2020 · 2 comments

Comments

@andre-brdoch
Copy link

Hi guys,

we want to use cloudinary image urls only, since they offer more powerful transformations, and because our frontend is already configured for cloudinary!

However, in the sanity payloads only sanity image urls are included. I read here, how to reconstruct the full cloudinary URL. However, for that an additional request to the asset is required, and overall not very handy if we only want to use cloudinary. Is it somehow possible to directly return the cloudinary url in the payload, or is there any other way to easily access the cloudinary url?

@ontoneio
Copy link

ontoneio commented Dec 6, 2020

@andre-brdoch

Maybe check this piece in the code. As this is where it looks like he is possibly handling the transformation to a Sanity Image asset type.

image

@andre-brdoch
Copy link
Author

@ontoneio Thanks 👌 In the end we modified the plugin a bit to store the full cloudinary path on the asset.

However, the extra request does not seem to be avoidable unfortunately with how images work in Sanity, since they are references and only the ID is accessible without extra request to the full asset. So now we are doing that extra request, which is not so bad since our website is static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants