mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What Strip the search query for the `urlPathname` passed down to metadata handling. ### Why This is because the `urlPathname` from `staticGenerationStore` contains query, so it will contain `?rsc` query for client navigation, which lead to the relative path canonical url (e.g. `./`) will have the search query along with it. This PR is to remove that and make sure always uses pathname. Reported by @pacocoursey Closes NEXT-2963
24 lines
557 B
TypeScript
24 lines
557 B
TypeScript
export default function Page() {
|
|
return <p id="alternates">alternate</p>
|
|
}
|
|
|
|
export async function generateMetadata(props, parentResolvingMetadata) {
|
|
const parentMetadata = await parentResolvingMetadata
|
|
|
|
return {
|
|
...parentMetadata,
|
|
alternates: {
|
|
...parentMetadata.alternates,
|
|
media: {
|
|
'only screen and (max-width: 600px)': '/mobile',
|
|
},
|
|
types: {
|
|
'application/rss+xml': [
|
|
{ url: '/blog.rss', title: 'rss' },
|
|
{ url: '/blog/js.rss', title: 'js title' },
|
|
],
|
|
},
|
|
},
|
|
}
|
|
}
|