rsnext/test/e2e/app-dir/metadata-dynamic-routes
Juan Settecase e4cd547a50
feat: add support for localizations in sitemap generator (#53765)
### What?

Following up with [this
suggestion](https://github.com/vercel/next.js/discussions/53540) I went
ahead and implemented the proposal for the Next.js team to merge it if
they agree.

Things to keep in mind:
- Google has [three different
ways](https://developers.google.com/search/docs/specialty/international/localized-versions#methods-for-indicating-your-alternate-pages)
to do this. The three of them are equivalent
- Google seems to be the only search engine supporting this approach.
The rest of them should ignore it

### Why?

This is supported by
[Google](https://developers.google.com/search/docs/specialty/international/localized-versions#example_2)
to better understand the site when the same page is available in
multiple languages.

### How?

- I added a new key to the `MetadataRoute.Sitemap` type called
`alternates` which accepts just one sub key `languages` similar to the
current one in the
[Metadata](https://nextjs.org/docs/app/api-reference/functions/generate-metadata#alternates)
object
- I updated the `resolveSitemap` method to process the new key and
generate the expected sitemap
- I updated the related tests and documentation to reflect the new
syntax

---------

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
2024-03-20 17:00:20 +00:00
..
app feat: add support for localizations in sitemap generator (#53765) 2024-03-20 17:00:20 +00:00
assets Add test for using custom font in metadata image routes (#54274) 2023-08-19 14:29:18 +00:00
index.test.ts feat: add support for localizations in sitemap generator (#53765) 2024-03-20 17:00:20 +00:00
next.config.js Fix trailing slash for canonical url (#62109) 2024-02-15 18:57:15 +01:00