diff --git a/app/(root)/blog/[slug]/page.tsx b/app/(root)/blog/[slug]/page.tsx index 9b0debf..0098565 100644 --- a/app/(root)/blog/[slug]/page.tsx +++ b/app/(root)/blog/[slug]/page.tsx @@ -31,11 +31,11 @@ export async function generateMetadata(props: { const postData = post[0]; return { - title: postData.title ?? "Untitled Post", - description: postData.excerpt ?? "No description provided.", + title: postData.title.value ?? "Untitled Post", + description: postData.excerpt.value ?? "No description provided.", openGraph: { - title: postData.title, - description: postData.excerpt, + title: postData.title.value, + description: postData.excerpt.value, images: postData.imageUrl ? [{ url: postData.imageUrl }] : [], url: `https://www.redotengine.org//blog/${slug}`, type: "article", @@ -47,8 +47,8 @@ export async function generateMetadata(props: { }, twitter: { card: "summary_large_image", - title: postData.title, - description: postData.excerpt, + title: postData.title.value, + description: postData.excerpt.value, images: postData.imageUrl ? [postData.imageUrl] : [], }, }; diff --git a/app/(root)/blog/page.tsx b/app/(root)/blog/page.tsx index b1ae4e3..f71f348 100644 --- a/app/(root)/blog/page.tsx +++ b/app/(root)/blog/page.tsx @@ -1,6 +1,7 @@ import { getUsedTags, getLatestArticle, getPosts } from "@/lib/blog"; import BlogClient from "@/components/sections/blog/BlogClient"; import type { Metadata } from "next"; +import { getLanguage } from "@/actions/language"; export const metadata: Metadata = { title: "Blog", @@ -14,7 +15,7 @@ export default async function Blog() { const search = searchParams.get("search") ?? ""; const posts = await getPosts(selectedTag, search); - const latestBlog = await getLatestArticle(); + const latestBlog = await getLatestArticle(await getLanguage()); return ; }