mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Use should only need to configure one `metadataBase` as fixed domain or
url but metadata image routes can still work properly with `VERCEL_URL`
in preview deployments
If you configured `new URL('https://mydomain.com')`, it will work for
canonical url all the time since it's for SEO.
For preview deployments metadata image routes will work with deployment
url as they're always bound with deployment.
For production deployments metadata images routes can be alias to the
configured `metadataBase` as they could be the expected exposed domain
Follow up for #47910
link NEXT-887
23 lines
464 B
TypeScript
23 lines
464 B
TypeScript
export default function Layout({ children }) {
|
|
return (
|
|
<html>
|
|
<head></head>
|
|
<body>{children}</body>
|
|
</html>
|
|
)
|
|
}
|
|
|
|
export const metadata = {
|
|
metadataBase: new URL('https://mydomain.com'),
|
|
title: 'Next.js App',
|
|
description: 'This is a Next.js App',
|
|
twitter: {
|
|
cardType: 'summary_large_image',
|
|
title: 'Twitter - Next.js App',
|
|
description: 'Twitter - This is a Next.js App',
|
|
},
|
|
alternates: {
|
|
canonical: './',
|
|
},
|
|
}
|