diff --git a/src/app/(main)/berita/[slug]/opengraph-image.tsx b/src/app/(main)/berita/[slug]/opengraph-image.tsx index 5eb4b41..77e6137 100644 --- a/src/app/(main)/berita/[slug]/opengraph-image.tsx +++ b/src/app/(main)/berita/[slug]/opengraph-image.tsx @@ -129,6 +129,16 @@ export const options: ImageResponseOptions = { ], }; +export function generateImageMetadata() { + return [ + { + contentType: "image/jpeg", + size: { width: 600, height: 600 }, + id: "medium", + }, + ]; +} + export default async function opengraphImage({ params, }: { diff --git a/src/app/(main)/berita/[slug]/page.tsx b/src/app/(main)/berita/[slug]/page.tsx index 88bff1a..b529fcf 100644 --- a/src/app/(main)/berita/[slug]/page.tsx +++ b/src/app/(main)/berita/[slug]/page.tsx @@ -28,12 +28,12 @@ export async function generateMetadata({ return { title: post.title, - description: post.description, + description: post.description.trim() || null, authors: { name: post.user.name }, openGraph: { url: `${process.env.URL ?? "https://www.moklet.org"}/berita/${post.slug}`, title: post.title, - description: post.description, + description: post.description.trim() || undefined, type: "article", publishedTime: new Date(post.published_at!).toISOString(), modifiedTime: new Date(post.updated_at).toISOString(), @@ -57,12 +57,10 @@ export default async function Post({ const jsonLd: WithContext = { "@context": "https://schema.org", "@type": "NewsArticle", - image: post.thumbnail, description: post.description, headline: post.title, datePublished: new Date(post.published_at!).toISOString(), dateModified: new Date(post.updated_at).toISOString(), - thumbnailUrl: post.thumbnail, }; return (