Adding Image Metadata to Portable Text (Gridsome Starter)

6 replies
Last updated: Nov 2, 2020
Hello,I have a maybe small question.

I have added metadata to images like here. It works ( )But the Problem is when I add the Objects "location" and "exif" to the PortableText, than they will not be applied.
I dont get the "Metadata" with the image.

I'm using the standard Gridsome Sanity Blog Starter Template


type: 'mainImage',

options: {hotspot: true, metadata: ['location', 'palette', 'exif']  },

Nov 2, 2020, 1:17 PM
This would only be applied for new uploaded images, I think.
Have you tried uploading a new one and see if that gets the metadata?
Nov 2, 2020, 1:24 PM
Thank you. I tried it. But no luck. The normal "mainImage" gives me metadata. The image in the Content Block not. I searched all Docs and this channel.
Nov 2, 2020, 1:31 PM
Right, so you will have to resolve the reference to get the data from the asset document..You have to use a raw field and
Nov 2, 2020, 1:40 PM
💯 Thank you! This was the missing part. Thank you for your time
Nov 2, 2020, 1:46 PM
Nov 2, 2020, 1:47 PM – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.