mirror of
https://github.com/sammyshear/sshear.dev.git
synced 2025-12-06 03:15:53 +00:00
27 lines
583 B
Plaintext
27 lines
583 B
Plaintext
---
|
|
import PostLayout from "../../../layouts/PostLayout.astro";
|
|
import Post from "../../../components/Post.astro";
|
|
import { getCollection, type CollectionEntry } from "astro:content";
|
|
|
|
export interface Props {
|
|
post: CollectionEntry<"blog">;
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
const posts = await getCollection("blog");
|
|
|
|
const postResult = posts.map((post) => ({
|
|
params: { slug: post.slug },
|
|
props: { post }
|
|
}));
|
|
|
|
return [...postResult];
|
|
}
|
|
|
|
const { post } = Astro.props;
|
|
---
|
|
|
|
<PostLayout frontmatter={{ title: post.data.title }}>
|
|
<Post post={post} />
|
|
</PostLayout>
|