Hey there 👋
I'm trying to get this to work, but it's been difficult. I want to inject images somehow into a page (so like this file.md > component.astro > page.astro) where i'm doing this in the component.astro:
---
const { articleFolder } = Astro.props;
import { Image } from 'astro:assets';
import myImage from `../pages/${articleFolder}/my_image.png`;
---
<Image src={myImage} />
Which doesn't put the image into optimization.
Or like this:
const { articleFolder } = Astro.props;
import { getImage } from "astro:assets";
import myImage from `../pages/${articleFolder}/my_image.png`
const optimizedImage = await getImage({src: myImage, format: 'avif'})
---
<img src={optimizedImage.src} />
Which only accepts string so i'm not even sure if doing this part right with getImage()...
Is this even possible or somehow near the desired output and i'm just missing something obvious? Any ideas on how to accomplish this?