Unverified Commit 4ceb7705 authored by Joseph's avatar Joseph Committed by GitHub

docs: opengraph-image papercuts (#92018)

Follow up to https://github.com/vercel/next.js/pull/91893
parent db08109f
......@@ -53,7 +53,7 @@ Add a `twitter-image.(jpg|jpeg|png|gif)` image file to any route segment.
### `opengraph-image.alt.txt`
Add an accompanying `opengraph-image.alt.txt` file in the same route segment as the `opengraph-image.(jpg|jpeg|png|gif)` image it's alt text.
Add an accompanying `opengraph-image.alt.txt` file in the same route segment as the `opengraph-image.(jpg|jpeg|png|gif)` image its alt text.
```txt filename="opengraph-image.alt.txt"
About Acme
......@@ -65,14 +65,14 @@ About Acme
### `twitter-image.alt.txt`
Add an accompanying `twitter-image.alt.txt` file in the same route segment as the `twitter-image.(jpg|jpeg|png|gif)` image it's alt text.
Add an accompanying `twitter-image.alt.txt` file in the same route segment as the `twitter-image.(jpg|jpeg|png|gif)` image its alt text.
```txt filename="twitter-image.alt.txt"
About Acme
```
```html filename="<head> output"
<meta property="twitter:image:alt" content="About Acme" />
<meta name="twitter:image:alt" content="About Acme" />
```
## Generate images using code (.js, .ts, .tsx)
......@@ -90,7 +90,7 @@ Generate a route segment's shared image by creating an `opengraph-image` or `twi
>
> - By default, generated images are [**statically optimized**](/docs/app/glossary#prerendering) (generated at build time and cached) unless they use [Request-time APIs](/docs/app/glossary#request-time-apis) or uncached data.
> - You can generate multiple Images in the same file using [`generateImageMetadata`](/docs/app/api-reference/functions/generate-image-metadata).
> - `opengraph-image.js` and `twitter-image.js` are special Route Handlers that is cached by default unless it uses a [Request-time API](/docs/app/glossary#request-time-apis) or [dynamic config](/docs/app/guides/caching-without-cache-components#dynamic) option.
> - `opengraph-image.js` and `twitter-image.js` are special Route Handlers that are cached by default unless it uses a [Request-time API](/docs/app/glossary#request-time-apis) or [dynamic config](/docs/app/guides/caching-without-cache-components#dynamic) option.
The easiest way to generate an image is to use the [ImageResponse](/docs/app/api-reference/functions/image-response) API from `next/og`.
......
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