Files
website/src/pages/read/[...slug].astro

21 lines
459 B
Plaintext

---
import { type CollectionEntry, getCollection } from "astro:content";
import BookRead from "../../layouts/BookRead.astro";
export async function getStaticPaths() {
const posts = await getCollection("read");
return posts.map((post) => ({
params: { slug: post.slug },
props: post,
}));
}
type Props = CollectionEntry<"read">;
const post = Astro.props;
const { Content } = await post.render();
---
<BookRead {...post.data}>
<Content />
</BookRead>