mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
22 lines
469 B
Plaintext
22 lines
469 B
Plaintext
---
|
|
import { CollectionEntry, getCollection } from "astro:content";
|
|
import ArticleLayout from "@root/layouts/article.astro";
|
|
|
|
export async function getStaticPaths() {
|
|
const posts = await getCollection("blog");
|
|
return posts.map((post) => ({
|
|
params: { slug: post.slug },
|
|
props: post,
|
|
}));
|
|
}
|
|
|
|
type Props = CollectionEntry<"blog">;
|
|
|
|
const post = Astro.props;
|
|
const { Content } = await post.render();
|
|
---
|
|
|
|
<ArticleLayout content={post}>
|
|
<Content />
|
|
</ArticleLayout>
|