Unverified Commit dc5fe225 authored by KAM's avatar KAM Committed by GitHub

docs: document metadata pagination field (#95509)

### What?

Documents the `pagination` metadata field in the `generateMetadata` API
reference.

### Why?

The `Metadata` type supports `pagination.previous` and
`pagination.next`, but the Metadata Fields documentation did not list
the field.

Fixes #83264

### How?

Adds a `pagination` section with an example and the generated `<link
rel="prev">` / `<link rel="next">` output.

### Tests

- `pnpm prettier --check
docs/01-app/03-api-reference/04-functions/generate-metadata.mdx`
- `pnpm lint-eslint
docs/01-app/03-api-reference/04-functions/generate-metadata.mdx`
- `git diff --check HEAD~1..HEAD`

<!-- NEXT_JS_LLM_PR -->
parent d07b580f
...@@ -923,6 +923,24 @@ export const metadata = { ...@@ -923,6 +923,24 @@ export const metadata = {
<link rel="bookmarks" href="https://nextjs.org/13" /> <link rel="bookmarks" href="https://nextjs.org/13" />
``` ```
### `pagination`
Describes the previous and next pages in a paginated sequence.
```jsx filename="layout.js | page.js"
export const metadata = {
pagination: {
previous: 'https://nextjs.org/blog?page=1',
next: 'https://nextjs.org/blog?page=3',
},
}
```
```html filename="<head> output" hideLineNumbers
<link rel="prev" href="https://nextjs.org/blog?page=1" />
<link rel="next" href="https://nextjs.org/blog?page=3" />
```
### `category` ### `category`
```jsx filename="layout.js | page.js" ```jsx filename="layout.js | page.js"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment