init
This commit is contained in:
commit
f9ab31c247
62 changed files with 7894 additions and 0 deletions
21
src/pages/en/[...slug].astro
Normal file
21
src/pages/en/[...slug].astro
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
import { type CollectionEntry, render } from 'astro:content';
|
||||
import Post from '~/layouts/Post.astro';
|
||||
import { getPostsByLocale, postSlug } from '~/i18n/posts';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getPostsByLocale('en');
|
||||
return posts.map((post) => ({
|
||||
params: { slug: postSlug(post) },
|
||||
props: post,
|
||||
}));
|
||||
}
|
||||
type Props = CollectionEntry<'posts'>;
|
||||
|
||||
const post = Astro.props;
|
||||
const { Content } = await render(post);
|
||||
---
|
||||
|
||||
<Post {...post.data} locale="en" entry={post}>
|
||||
<Content />
|
||||
</Post>
|
||||
Loading…
Add table
Add a link
Reference in a new issue