feat: convert site to astro via codex
This commit is contained in:
355 files changed
+19954
-6
No files matched your search
@@ -0,0 +1,11 @@
|
||||
---
|
||||
import { getCollection, render } from 'astro:content';
|
||||
import BlogPostLayout from '../../layouts/BlogPostLayout.astro';
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog', ({ data }) => data.lang === 'en' && !data.draft);
|
||||
return posts.map((entry) => ({ params: { slug: entry.data.slug }, props: { entry } }));
|
||||
}
|
||||
const { entry } = Astro.props;
|
||||
const { Content } = await render(entry);
|
||||
---
|
||||
<BlogPostLayout entry={entry}><Content /></BlogPostLayout>
|
||||
Reference in new issue
Block a user