Update page.tsx

This commit is contained in:
Riccardo Giorato
2025-12-26 22:09:34 +01:00
parent a719bd69ad
commit b64efc71f6
+5 -1
View File
@@ -19,12 +19,15 @@ export async function generateMetadata({
}; };
} }
const { story } = result; const { story, pages } = result;
const title = `${story.title} | MakeComics`; const title = `${story.title} | MakeComics`;
const description = const description =
story.description || story.description ||
`${story.title} - Create your own comic book with MakeComics`; `${story.title} - Create your own comic book with MakeComics`;
// Use the first page's image as the Open Graph image, or default if none
const firstPageImage = pages.length > 0 && pages[0].generatedImageUrl ? pages[0].generatedImageUrl : "/placeholder.jpg";
return { return {
title, title,
description, description,
@@ -32,6 +35,7 @@ export async function generateMetadata({
title, title,
description, description,
type: "website", type: "website",
images: [firstPageImage],
}, },
}; };
} catch (error) { } catch (error) {