Any way to use generateMetadata with generateStaticParams?
Unanswered
West African Lion posted this in #help-forum
West African LionOP
I'm trying to set the metadata of my generated pages according to the data coming from the CMS. This is the code I have to generate the static sites:
This is how I grab that data:
Is there any way for me to hook into this rather than trying to fetch the same data again?
export const generateStaticParams = async () => {
const { items } = await client.getEntries({ content_type: "landingPage" });
return items.map((article) => ({
slug: article.fields.slug?.toString(),
}));
};This is how I grab that data:
const { items } = await client.getEntries({
content_type: "landingPage",
"fields.slug": params?.slug,
});Is there any way for me to hook into this rather than trying to fetch the same data again?