sanity-io / sanity-template-astro-clean

Clean starter template with Astro
https://template-astro-clean.sanity.build/
119 stars 40 forks source link

PortableText [components.type] is missing "image" #60

Open Bobetti opened 1 month ago

Bobetti commented 1 month ago

If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.

Describe the bug

If I add an image inside blog post in sanity studio, between the post texts, this image will not be shown. (where do you see blog posts without images?). All text is shown correctly.

To Reproduce In Sanity studio,

Expected behavior

A blog post must contain and show images within texts!

Which versions of Sanity are you using?

Latest on the moment of this bug writing.

Run sanity versions in the terminal and copy-paste the result here.

What operating system are you using?

Windows 10

Which versions of Node.js / npm are you running?

v22.8.0

Additional context

Took your code and inserted my project Id and dataset. Nothing changed, and there are no images inside post.

Also played with my own website and tested different variations, but no luck. Google solutions didn't help. Claude gpt - didn't help.

I'm frustrated, how people using this, if no documentation provided!

mark-heffernan commented 4 days ago

This link might be able to help you out - https://developers.netlify.com/guides/how-to-use-sanity-portable-text-with-astro/#rendering-images

Bobetti commented 3 days ago

@mark-heffernan Thank you very much, finally some working example. Because I went a hard path and parsed blockContent as ordinary json and placed on the page each block separately.