e4cd547a50
### 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> |
||
---|---|---|
.. | ||
404-page-router | ||
app-dir | ||
app-dir-legacy-edge-runtime-config | ||
basepath | ||
browserslist | ||
browserslist-extends | ||
cancel-request | ||
children-page | ||
config-promise-export | ||
config-schema-check | ||
conflicting-app-page-error | ||
custom-app-render | ||
disable-js-preload | ||
dynamic-route-interpolation | ||
edge-api-endpoints-can-receive-body | ||
edge-async-local-storage | ||
edge-can-read-request-body | ||
edge-can-use-wasm-files | ||
edge-compiler-can-import-blob-assets | ||
edge-compiler-module-exports-preference | ||
edge-configurable-runtime | ||
edge-pages-support | ||
edge-runtime-pages-api-route | ||
edge-runtime-uses-edge-light-import-specifier-for-packages | ||
esm-externals | ||
favicon-short-circuit | ||
fetch-failures-have-good-stack-traces-in-edge-runtime | ||
getserversideprops | ||
handle-non-hoisted-swc-helpers | ||
hello-world | ||
i18n-api-support | ||
i18n-data-fetching-redirect | ||
i18n-data-route | ||
i18n-default-locale-redirect | ||
i18n-disallow-multiple-locales | ||
i18n-ignore-redirect-source-locale | ||
i18n-ignore-rewrite-source-locale | ||
i18n-preferred-locale-detection | ||
ignore-invalid-popstateevent | ||
instrumentation-hook | ||
instrumentation-hook-src | ||
link-with-api-rewrite | ||
manual-client-base-path | ||
middleware-base-path | ||
middleware-custom-matchers | ||
middleware-custom-matchers-basepath | ||
middleware-custom-matchers-i18n | ||
middleware-dynamic-basepath-matcher | ||
middleware-fetches-with-any-http-method | ||
middleware-fetches-with-body | ||
middleware-general | ||
middleware-matcher | ||
middleware-redirects | ||
middleware-request-header-overrides | ||
middleware-responses | ||
middleware-rewrites | ||
middleware-shallow-link | ||
middleware-trailing-slash | ||
module-layer | ||
multi-zone | ||
new-link-behavior | ||
next-font | ||
next-head | ||
next-image-forward-ref | ||
next-phase | ||
next-script | ||
no-eslint-warn-with-no-eslint-config | ||
nonce-head-manager | ||
og-api | ||
opentelemetry | ||
optimized-loading | ||
pages-performance-mark | ||
postcss-config-cjs | ||
prerender | ||
prerender-native-module | ||
proxy-request-with-middleware | ||
react-dnd-compile | ||
reload-scroll-backforward-restoration | ||
repeated-forward-slashes-error | ||
skip-trailing-slash-redirect | ||
socket-io | ||
ssr-react-context | ||
streaming-ssr | ||
styled-jsx | ||
swc-warnings | ||
switchable-runtime | ||
test-template/{{ toFileName name }} | ||
test-utils-tests/basic | ||
testmode | ||
third-parties | ||
trailingslash-with-rewrite | ||
transpile-packages | ||
type-module-interop | ||
typescript-version-no-warning | ||
typescript-version-warning | ||
undici-fetch | ||
useselectedlayoutsegment-s-in-pages-router | ||
yarn-pnp/test | ||
basepath-trailing-slash.test.ts | ||
basepath.test.ts | ||
example-file.txt | ||
example.txt | ||
prerender-crawler.test.ts | ||
prerender-native-module.test.ts | ||
prerender.test.ts |