import { getCollection } from "astro:content";
import { Image } from "astro:assets";
import BaseLayout from "@layouts/BaseLayout.astro";
import type { CollectionEntry } from "astro:content";
const myBooks: CollectionEntry<"books">[] = await getCollection("books");
<BaseLayout>
{
myBooks.map((book) => (
<section>
<div class="h-full rounded-3xl bg-lightblue-950 p-8">
<div class="mt-8">
<Image src={book.data.bookInfo.cover.image} alt={book.data.bookInfo.cover.alt} />
<br />
{book.data.bookInfo.cover.image}
</div>
</div>
</div>
</div>
</section>
))
}
</BaseLayout>
I am being told [LocalImageUsedWrongly] Image's and getImage's src parameter must be an imported image or an URL, it cannot be a string filepath. Received ./BookCover.jpg. That is the path in the frontmatter. Image is in the content folder.