--- import Layout from "../layouts/Layout.astro"; import { getCollection } from 'astro:content'; // Fetch all entries from the 'books' collection const allBooks = await getCollection('books'); ---

My Book List

{allBooks.map(book => (
{`${book.data.title}

{book.data.title}

by {book.data.author} ({book.data.year})

{book.data.genre} • Rating: {book.data.rating}/5

{/* Accessing the Markdown body for the description */}

{book.body}

))}