Files
homepage/src/pages/blog/university/[id].astro

27 lines
681 B
Plaintext

---
import { getCollection, render } from 'astro:content';
import BlogPost from '@layouts/BlogPost.astro';
import type {
InferGetStaticParamsType,
InferGetStaticPropsType,
GetStaticPaths,
} from "astro";
export const getStaticPaths = (async () => {
const posts = await getCollection('uni');
return posts.map(post => ({
params: { id: post.id },
props: { post },
}));
}) satisfies GetStaticPaths;
type Params = InferGetStaticParamsType<typeof getStaticPaths>;
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
const { post } = Astro.props;
const { Content } = await render(post);
---
<BlogPost {...post.data}>
<Content />
</BlogPost>