add notes and web pages for them
This commit is contained in:
20
src/pages/read/[...slug].astro
Normal file
20
src/pages/read/[...slug].astro
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
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>
|
Reference in New Issue
Block a user