diff --git a/src/app/updates/[id]/page.jsx b/src/app/updates/[id]/page.jsx index db89eb0..1c80adf 100644 --- a/src/app/updates/[id]/page.jsx +++ b/src/app/updates/[id]/page.jsx @@ -9,6 +9,40 @@ export function generateStaticParams() { })) } +// Add dynamic metadata for each update +export async function generateMetadata({ params }) { + const post = updates.find((p) => p.id.toString() === params.id); + if (!post) { + return { + title: 'Update Not Found | LiteNet', + description: 'This update could not be found.', + }; + } + return { + title: `${post.title} | LiteNet Updates`, + description: post.summary, + openGraph: { + title: `${post.title} | LiteNet Updates`, + description: post.summary, + type: 'article', + publishedTime: post.timestamp, + authors: [post.author?.name], + images: [ + { + url: post.author?.avatar || 'https://litenet.tel/litenet-logo.png', + alt: post.author?.name || 'LiteNet', + } + ], + }, + twitter: { + card: 'summary_large_image', + title: `${post.title} | LiteNet Updates`, + description: post.summary, + images: [post.author?.avatar || 'https://litenet.tel/litenet-logo.png'], + }, + }; +} + export default function BlogPost({ params }) { const post = updates.find((p) => p.id.toString() === params.id)