#Images woes

15 messages · Page 1 of 1 (latest)

signal zephyr
#

I am having a terible time understanding how images work in Astro. It seems that the only way to use images in collections and data (json) is to place them in the public dir, but then you can't use the image optimization. Is there something I am missing? Is there a way to parse images from a collection AND optimize them?

west pierBOT
#
Still waiting for an answer?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.

long loom
signal zephyr
#

Thank you. I have read the docs several times and in general know how images work. Unfortunately the docs do not discuss programatically using the <Image> feature for collections or json.

tulip oxide
#

The first link is about images in collection

#

It's basically just using the image() schema for all the fields that are images

signal zephyr
#

wow. I stand corrected. I have searched and searched and never saw the specific docs for images in collections. How the heck was that so hidden. Thanks again!

signal zephyr
#

There is the schema setup

#

but I am getting an empty object when I oonsole. Hmmm. Any ideas out there?

#

It says I need to import image and can't use a string. If I include the <Image> the app crashes.

#

ooooof!

tulip oxide
#

You're passing a title as the src

signal zephyr
#

oh Erika. Thank you. I just woke up from a nap. You are the best. I promise I'm not usually so silly.

#

I copied that from the line above. So dumb!

#

Sadly, its still not working.