1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

build(deps): update Next.js to v15 and ESLint to v9

This commit is contained in:
2024-11-09 19:50:22 +01:00
parent 59153a7a69
commit 9e840b8dae
74 changed files with 3206 additions and 3749 deletions

View File

@ -4,19 +4,20 @@ import { notFound } from "next/navigation"
import { getBlogPostBySlug, getBlogPosts } from "@repo/blog"
import { BlogPostUI } from "@repo/blog/BlogPostUI"
import type { Locale } from "@repo/utils/constants"
import { unstable_setRequestLocale } from "next-intl/server"
import { setRequestLocale } from "next-intl/server"
interface BlogPostPageProps {
params: {
params: Promise<{
slug: string
locale: Locale
}
}>
}
export const generateMetadata = async (
props: BlogPostPageProps,
): Promise<Metadata> => {
const blogPost = await getBlogPostBySlug(props.params.slug)
const { slug } = await props.params
const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) {
return notFound()
}
@ -50,10 +51,11 @@ export const generateStaticParams = async (): Promise<
const BlogPostPage: React.FC<BlogPostPageProps> = async (props) => {
const { params } = props
const { locale, slug } = await params
// Enable static rendering
unstable_setRequestLocale(params.locale)
setRequestLocale(locale)
const blogPost = await getBlogPostBySlug(params.slug)
const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) {
return notFound()
}