2024-07-30 23:59:06 +02:00
|
|
|
import { getBlogPosts } from "@repo/blog"
|
|
|
|
import { BlogPosts } from "@repo/blog/BlogPosts"
|
|
|
|
import { LOCALE_DEFAULT, type LocaleProps } from "@repo/i18n/config"
|
2024-07-31 11:41:39 +02:00
|
|
|
import { MainLayout } from "@repo/ui/Layout/MainLayout"
|
2024-07-30 23:59:06 +02:00
|
|
|
import {
|
|
|
|
Section,
|
|
|
|
SectionDescription,
|
|
|
|
SectionTitle,
|
2024-07-31 11:41:39 +02:00
|
|
|
} from "@repo/ui/Layout/Section"
|
2024-07-30 23:59:06 +02:00
|
|
|
import type { Metadata } from "next"
|
|
|
|
import { unstable_setRequestLocale } from "next-intl/server"
|
|
|
|
|
|
|
|
const title = "Blog | Théo LUDWIG"
|
|
|
|
const description =
|
|
|
|
"The latest news about my journey of learning computer science."
|
|
|
|
|
|
|
|
export const generateMetadata = async (): Promise<Metadata> => {
|
|
|
|
return {
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
openGraph: {
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
locale: LOCALE_DEFAULT,
|
|
|
|
},
|
|
|
|
twitter: {
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BlogPageProps extends LocaleProps {}
|
|
|
|
|
|
|
|
const BlogPage: React.FC<BlogPageProps> = async (props) => {
|
|
|
|
const { params } = props
|
|
|
|
|
|
|
|
// Enable static rendering
|
|
|
|
unstable_setRequestLocale(params.locale)
|
|
|
|
|
|
|
|
const posts = await getBlogPosts()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<MainLayout>
|
|
|
|
<Section verticalSpacing horizontalSpacing>
|
|
|
|
<SectionTitle>Blog</SectionTitle>
|
|
|
|
<SectionDescription>{description}</SectionDescription>
|
|
|
|
|
|
|
|
<BlogPosts posts={posts} />
|
|
|
|
</Section>
|
|
|
|
</MainLayout>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default BlogPage
|