I'm trying to follow NextJS and Prismic tutorial, which i followed thoroughly, when i got an issue in generateMetadata specifically in image.
As mentioned in this tutorial https://prismic.io/academy/prismic-and-nextjs/5-add-content-to-your-html/2-static-zone-simple-fields, they used it like this
export async function generateMetadata() {
const page = await queryHomepage()
return {
openGraph: {
title: page.data.meta_title,
description: prismic.asText(page.data.meta_description),
images: prismic.asImageSrc(page.data.meta_image)
}
}
}
In my case, I used it like this
export async function generateMetadata({
params,
}: {
params: { slug: string };
}) {
const page = await queryMarketingPage(params.slug);
return {
title: page.data.meta_title,
description: page.data.meta_description,
Images: prismic.asImageSrc(page.data.meta_image),
openGraph: {
title: page.data.meta_title,
description: page.data.meta_description,
Images: prismic.asImageSrc(page.data.meta_image),
},
};
}
Title and description works fine, except the image. I confirmed that the prismic.asImageSrc(page.data.meta_image)
is not the problem, I tried put the image in the page and it's shown. I also added images.prismic.io to next config.
I dont know whats wrong, here is the head output i got