// pages/posts.astro
const allPosts = await Astro.glob("../pages/posts/*.md");
---
allPosts.map((post)) => (
<img
src={post.frontmatter.image.url}
alt={post.frontmatter.image.alt}
class="rounded-3xl p-2"
/>
# pages/posts/Capsule.md
---
image:
url "../../images/capsule.gif"
---
# pages/posts/Banana.md
---
image:
url "imagehost.com/banana"
---
Im trying to use the image defined in the markdown post's frontmatter on my blog index page. Following the guide online, I defined it and used it the way shown. But when Im trying to use local images, it does not work.
So Banana.md's image shows up, but Capsule.md's does not.
I kinda wanted to use <Image/> anyways since I want the benefits and I learnt that way first anyways, but from looking around it doesn't seem possible?
So I guess my question is, whats the proper way to do this?
Thanks