dynamic metadata for updates

This commit is contained in:
rocord01 2025-08-01 00:33:15 -04:00
parent d3dc67f137
commit bc07ac55b0

View file

@ -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)