Replies: 18 comments
-
Hi @josu24, you need to specify the frontmatter like this
Ensure you include the |
Beta Was this translation helpful? Give feedback.
-
@Chuloo Could this be done automatically when I create a post or do I need to do this manually on every frontmatter? |
Beta Was this translation helpful? Give feedback.
-
No, it would be done automatically, so long as you have any node object with those fields in frontImageDesktop it would convert them to a childCloudinaryAsset node. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do the exact same thing as @josu24 with gatsby-transformer-cloudinary and NetlifyCMS. When I choose an image with netlify-cms-media-library-cloudinary, it just saves the URL of the image into frontmatter as already mentioned, and doesn't create cloudinaryAssetData, originalWidth, originalHeight, etc. I've also tried using gatsby-source-cloudinary to upload local files in my project and then turn them into nodes using createRemoteImageNode(), but if I have a ton of different field names and it doesn't like it if multiple files have the same field like |
Beta Was this translation helpful? Give feedback.
-
@tonymamo for cloudinaryAssetData node to be created from a data node the below fields are required
In netlify CMS if you can specify these fields somehow then it would work. I don't get this portion of your statement "but if I have a ton of different field names and it doesn't like it if multiple files have the same field like node.heroImage. " |
Beta Was this translation helpful? Give feedback.
-
Hi @Chuloo thanks for the response. I'm looking into ways the the data node fields could be populated with netlify cms now, instead of it just saving off the path of the file. I'll update if I come up with anything. I'm also looking into using getFluidImageObject() using the file path from frontmatter, but still have the same issue of needing to know the height and width somehow. Regarding the second part, sorry I wasn't clear with what I was saying, it was the end of a long day! I have several files that have a field called "heroImage", and I get an error saying |
Beta Was this translation helpful? Give feedback.
-
@tonymamo The solution for me was to create new ImageNodes for the url:s i have in my front matter like this:
But I have a problem when I have a list of image-urls in my frontmatter, and would like to create a node (or something else?) that is an array of imageNodes...
|
Beta Was this translation helpful? Give feedback.
-
btw, are tracedSVG placeholders not supported? I dont seem to get any value on that field from the createRemoteImageNode function :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hey @tonymamo Would you mind sharing a demo for using I just don't know where I'm supposed to put this frontmatter field:
when the Cloudinary integration with Netlify CMS doesn't seem to allow that. |
Beta Was this translation helpful? Give feedback.
-
hey @bytrangle, I also have a field called
And in my config.yml file for Netlify CMS I define Cloudinary as my
Then, in my schema for a blog post, I have the following:
So, whenever Netlify CMS sees the image widget, it renders the Cloudinary Media Library. I also had to register the media library ( Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
@bytrangle I just noticed you said |
Beta Was this translation helpful? Give feedback.
-
@tonymamo Thank you. I meant When your images in Markdown files are links to remote resources, that means they won't be processed by I guess I can customize the GraphQL schema to add a new field whose value is a html string for an
Example of
What do you do? I wonder if there's already a solution that I'm not aware of. |
Beta Was this translation helpful? Give feedback.
-
Hi @bytrangle, For the cloudinary links I save in frontmatter fields, I then need to process them in my gatsby-node file using the
|
Beta Was this translation helpful? Give feedback.
-
@tonymamo |
Beta Was this translation helpful? Give feedback.
-
Hey @bytrangle |
Beta Was this translation helpful? Give feedback.
-
Hey @tonymamo |
Beta Was this translation helpful? Give feedback.
-
@bytrangle I think it does download items to the |
Beta Was this translation helpful? Give feedback.
-
Hello,
So my problem, that I would love to get some help with, is that I want to be able to query an childCloudinaryAsset on frontImageDesktop here to be able to use it with gatsby-image:
But I cant since my posts looks like this, frontImageDesktop only contains the url :
The Cloudinary assets are created and it works fine to query an asset like this:
What I would like to be able to do is this:
SETUP:
Beta Was this translation helpful? Give feedback.
All reactions