📝 add locale on blog ssr, add translations for other webpage content
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { getAllPosts } from '@/lib/markdown'
|
||||
import BlogPageClient from './blog-client'
|
||||
import {setRequestLocale} from 'next-intl/server'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
|
||||
export default async function BlogPage() {
|
||||
const posts = await getAllPosts()
|
||||
export default async function BlogPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params;
|
||||
await setRequestLocale(locale)
|
||||
const posts = await getAllPosts(locale)
|
||||
const allTags = Array.from(new Set(posts.flatMap(post => post.frontmatter.tags))).sort()
|
||||
|
||||
return <BlogPageClient posts={posts} allTags={allTags} />
|
||||
|
||||
Reference in New Issue
Block a user