test: i18n support

This commit is contained in:
radishzzz 2025-01-17 07:31:43 +00:00
parent d2bda0594d
commit 32ffec8480
8 changed files with 340 additions and 6 deletions

View file

@ -0,0 +1,23 @@
---
import Layout from '@/layouts/Layout.astro'
import { getCollection } from 'astro:content'
export async function getStaticPaths() {
const posts = await getCollection('posts')
return posts.map(post => ({
params: { slug: post.slug },
props: { post },
}))
}
const { post } = Astro.props
const { Content } = await post.render()
---
<Layout>
<article>
<h1>{post.data.title}</h1>
<time>{post.data.published.toISOString().split('T')[0]}</time>
<Content />
</article>
</Layout>