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:
@ -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()
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { getBlogPosts } from "@repo/blog"
|
||||
import { BlogPosts } from "@repo/blog/BlogPosts"
|
||||
import type { LocaleProps } from "@repo/i18n/config"
|
||||
import type { LocaleProps } from "@repo/i18n/routing"
|
||||
import { MainLayout } from "@repo/ui/Layout/MainLayout"
|
||||
import {
|
||||
Section,
|
||||
@ -9,7 +9,7 @@ import {
|
||||
} from "@repo/ui/Layout/Section"
|
||||
import { LOCALE_DEFAULT } from "@repo/utils/constants"
|
||||
import type { Metadata } from "next"
|
||||
import { unstable_setRequestLocale } from "next-intl/server"
|
||||
import { setRequestLocale } from "next-intl/server"
|
||||
|
||||
const title = "Blog | Théo LUDWIG"
|
||||
const description =
|
||||
@ -36,8 +36,9 @@ interface BlogPageProps extends LocaleProps {}
|
||||
const BlogPage: React.FC<BlogPageProps> = async (props) => {
|
||||
const { params } = props
|
||||
|
||||
const { locale } = await params
|
||||
// Enable static rendering
|
||||
unstable_setRequestLocale(params.locale)
|
||||
setRequestLocale(locale)
|
||||
|
||||
const posts = await getBlogPosts()
|
||||
|
||||
|
Reference in New Issue
Block a user