Skip to content

Commit

Permalink
docs: Clarify use cases for turning off alternate links and fix webma…
Browse files Browse the repository at this point in the history
…nifest links
  • Loading branch information
amannn committed Jul 12, 2024
1 parent 62da0d0 commit d1d2a84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion docs/pages/docs/routing/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ Note that by setting this option, the middleware will no longer return a `set-co

The middleware automatically sets [the `link` header](https://developers.google.com/search/docs/specialty/international/localized-versions#http) to inform search engines that your content is available in different languages. Note that this automatically integrates with your routing strategy and will generate the correct links based on your configuration.

If you prefer to include these links yourself, e.g. because you're using a CMS to manage localized slugs of your pages, you can opt-out of this behavior by setting `alternateLinks` to `false`.
However, there are cases where you may want to provide these links yourself:

1. You have pages that are only available for certain locales
2. You're using an external system like a CMS to manage localized slugs of your pages

In this case, you can opt-out of this behavior by setting `alternateLinks` to `false`.

```tsx filename="middleware.ts" {6}
import createMiddleware from 'next-intl/middleware';
Expand Down
4 changes: 2 additions & 2 deletions docs/public/favicon/site.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"short_name": "next-intl",
"icons": [
{
"src": "/android-chrome-192x192.png",
"src": "/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"src": "/favicon/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
Expand Down

0 comments on commit d1d2a84

Please sign in to comment.