#rendering portable text from sanity with remote image optimization?

4 messages · Page 1 of 1 (latest)

ashen ivy
#

Hello! I'm trying to render portable text from sanity. The portable text (blog post) contains remote image.
What's the best way of rendering the portable text in astro with optimization of the remote images? (similar to what <Image/> in the official image integration does. It should take a remote image src and output local images in dist

I'm trying out astro-portabletext but it does not seem to support images

GitHub

Render Portable Text with Astro. Contribute to theisel/astro-portabletext development by creating an account on GitHub.

ashen ivy
#

update: I figured out how to write custom component composed of Image for custom portable text node 🙂 no help is needed now

lusty badge
#

That is great to hear @ashen ivy 🙂

untold bane
#

I am looking for something similar, where images are uploaded in headless cms and I need to optimise the image during build time using the src attribute of the remote image and then push the optimised image to another hosting endpoint