Files
Jiachi LiuandGitHub 85033e3add Override file based images with social images property (#52416)
Metadata API should provide a way to override the filebased metadata
images. As usually for child routes, if there's new social images or
icons are provided, the ones from parent routes should be overridden /
skipped.

The `metadata` object export or `generateMetadata` should be able to do
that. Sometimes users still add other og info (besides images) to
metadata export (both object and `generateMetadata`).
I think we should check if they really have returned images property,
then decide to override.

- For the same level of routes:
- If there's no `openGraph.images` in the returned value, merge with
file based images
- If there's any `openGraph.images` in the returned value, ignore file
based ones

- For child level of routes:
Always override the parent level, ignoring parent level file based
images unless they use `generateMetadata` to merge from
`resolvingParentMetadata` value, then the parent level's file based ones
will present there


Closes NEXT-1418
2023-07-10 09:09:01 +02:00

16 lines
272 B
TypeScript

export default function Page() {
return 'opengraph-static-override'
}
export const metadata = {
icons: ['https://custom-icon-1.png'],
openGraph: {
title: 'no-og-image',
images: undefined,
},
twitter: {
title: 'no-tw-image',
images: null,
},
}