Skip to content

Commit 57bf33e

Browse files
committed
chore: bump
1 parent 67b8ddc commit 57bf33e

29 files changed

Lines changed: 4191 additions & 1377 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Changelog
22

33

4+
## v6.4.11...main
5+
6+
[compare changes](https://github.com/nuxt-modules/og-image/compare/v6.4.11...main)
7+
8+
### 🚀 Enhancements
9+
10+
- **nuxt-ui:** Color mode aware token resolution via `data-theme` ([#598](https://github.com/nuxt-modules/og-image/pull/598))
11+
12+
### 🩹 Fixes
13+
14+
- **fonts:** Skip fontaine fallbacks ([aa33012c](https://github.com/nuxt-modules/og-image/commit/aa33012c))
15+
- **takumi:** Treat single-entry variable fonts as axis-driven (defensive) ([#599](https://github.com/nuxt-modules/og-image/pull/599))
16+
- **takumi:** Keep variable WOFF2 over per-weight static fallback ([#600](https://github.com/nuxt-modules/og-image/pull/600))
17+
18+
### 🏡 Chore
19+
20+
- Bump ([01efcf4e](https://github.com/nuxt-modules/og-image/commit/01efcf4e))
21+
22+
### ❤️ Contributors
23+
24+
- Harlan Wilton ([@harlan-zw](https://github.com/harlan-zw))
25+
426
## v6.4.9...main
527

628
[compare changes](https://github.com/nuxt-modules/og-image/compare/v6.4.9...main)

devtools/app.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ function getHostOgImageDebugUrl(): string | undefined {
4343
return
4444
return new URL(content).pathname.replace(RE_IMAGE_EXT, '.json')
4545
}
46-
catch {}
46+
catch {
47+
// Cross-origin parent documents cannot be inspected; fall back to route options.
48+
}
4749
}
4850
4951
const { data: pathDebug, refresh: refreshPathDebug, status: pathDebugStatus } = useAsyncData<PathDebugResponse>('path-debug', async () => {

devtools/pages/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,9 @@ const productionHostname = computed(() => {
997997
rows="3"
998998
@change="(() => {
999999
try { editProp(key, JSON.parse(($event.target as HTMLTextAreaElement).value)) }
1000-
catch {}
1000+
catch {
1001+
// Invalid JSON is expected while editing; keep the previous prop value.
1002+
}
10011003
})()"
10021004
/>
10031005
<input

docs/content/3.guides/13.security.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Security
33
description: Learn about the security defaults and how to further harden your OG image endpoint.
44
---
55

6-
Nuxt OG Image ships with secure defaults. Image dimensions are clamped, renders are time limited, internal network requests are blocked, and user provided props are sanitized. No configuration is needed for these protections.
6+
Nuxt OG Image ships with secure defaults. The module clamps image dimensions, time limits renders, blocks internal network requests, and sanitizes user-provided props. These protections require no configuration.
77

88
The primary security concern with runtime OG image generation is **denial of service**: without protection, anyone can craft arbitrary image generation requests to your `/_og/d/` endpoint, consuming server CPU and memory. URL signing prevents this by ensuring only your application can generate valid image URLs.
99

@@ -36,15 +36,15 @@ Enabling `strict` mode applies all recommended security defaults in a single fla
3636

3737
Any of these can still be overridden explicitly. Strict mode only changes the defaults.
3838

39-
The build will fail if `strict` is enabled without a `secret`. Generate one with:
39+
The build will fail if you enable `strict` without a `secret`. Generate one with:
4040

4141
```bash
4242
npx nuxt-og-image generate-secret
4343
```
4444

4545
## URL Signing
4646

47-
When a signing secret is configured, every OG image URL includes a cryptographic signature in the path. The server verifies this signature before rendering, rejecting any URL that has been tampered with or crafted manually.
47+
When you configure a signing secret, every OG image URL includes a cryptographic signature in the path. The server verifies this signature before rendering, rejecting any URL that has been tampered with or crafted manually.
4848

4949
This prevents unauthorized image generation requests that would otherwise consume server resources.
5050

@@ -76,7 +76,7 @@ export default defineNuxtConfig({
7676

7777
### How It Works
7878

79-
When a secret is configured:
79+
When you configure a secret:
8080
- `defineOgImage()`{lang="ts"} appends a signature to the URL path: `/_og/d/w_1200,h_600,s_abc123def456.png`
8181
- The server extracts and verifies the signature before processing the request
8282
- Requests with missing or invalid signatures receive a `403` response
@@ -104,9 +104,9 @@ export default defineNuxtConfig({
104104
})
105105
```
106106

107-
When zero runtime is enabled:
108-
- No server-side rendering code is included in your production build
109-
- Images are generated once at build time and served as static assets
107+
When you enable zero runtime:
108+
- Your production build includes no server-side rendering code
109+
- The build generates images once and serves them as static assets
110110
- The `/_og` endpoint is not available at runtime
111111

112112
If your OG images don't need to change dynamically after deployment, this is the recommended approach.
@@ -157,7 +157,7 @@ If you find yourself passing large amounts of data through query parameters (tit
157157

158158
## Restrict Runtime Images to Origin
159159

160-
When runtime image generation is enabled, anyone who knows the `/_og` endpoint pattern can request an image directly. The `restrictRuntimeImagesToOrigin` option limits runtime generation to requests whose `Host` header matches your configured site URL.
160+
When you enable runtime image generation, anyone who knows the `/_og` endpoint pattern can request an image directly. The `restrictRuntimeImagesToOrigin` option limits runtime generation to requests whose `Host` header matches your configured site URL.
161161

162162
```ts [nuxt.config.ts]
163163
export default defineNuxtConfig({
@@ -173,7 +173,7 @@ export default defineNuxtConfig({
173173

174174
The module reads the `Host` header from each runtime request using h3's `getRequestHost` (with `X-Forwarded-Host` support for reverse proxies) and compares it against the host from your [Nuxt Site Config](https://nuxtseo.com/docs/site-config/getting-started/introduction) `url`. If the hosts don't match, the request receives a `403` response.
175175

176-
Because the `Host` header is mandatory in HTTP/1.1, this check works with all clients including social media crawlers. No `Origin` or `Referer` header is required.
176+
Because HTTP/1.1 requires the `Host` header, this check works with all clients including social media crawlers. The server does not need an `Origin` or `Referer` header.
177177

178178
### Allowing Additional Origins
179179

@@ -197,7 +197,7 @@ Prerendering and dev mode bypass the host check entirely.
197197

198198
## Debug Mode Warning
199199

200-
Enabling `ogImage.debug` in production exposes the `/_og/debug.json` endpoint. The module will log a warning at build time if debug is enabled outside of dev mode. Make sure to disable it before deploying.
200+
Enabling `ogImage.debug` in production exposes the `/_og/debug.json` endpoint. The module will log a warning at build time if you enable debug outside of dev mode. Make sure to disable it before deploying.
201201

202202
```ts [nuxt.config.ts]
203203
export default defineNuxtConfig({

docs/content/3.guides/3.runtime-cache.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Runtime Cache
33
description: How OG image caching works at runtime, including internal storage, CDN edge caching, and platform integration.
44
---
55

6-
When generating images at runtime, Nuxt OG Image provides two layers of caching to minimise server load and response times. For most deployments, the defaults work well and no configuration is needed.
6+
When generating images at runtime, Nuxt OG Image provides two layers of caching to minimise server load and response times. For most deployments, the defaults work well and require no configuration.
77

88
## Quick Start
99

@@ -50,7 +50,7 @@ That's it. The module handles cache headers, CDN integration, and cache key gene
5050

5151
### Layer 1: Internal Cache (Nitro Storage)
5252

53-
The module caches rendered image buffers in Nitro storage. On a cache hit, the image is served in ~5-30ms instead of re-rendering (400-3500ms).
53+
The module caches rendered image buffers in Nitro storage. On a cache hit, Nitro serves the image in ~5-30ms instead of re-rendering (400-3500ms).
5454

5555
By default, this uses **in-memory** storage. The cache is lost on server restart or redeployment. Configuring a [persistent storage driver](#persistent-storage) fixes this.
5656

@@ -83,7 +83,7 @@ The module sets `Cache-Control` on every OG image response so CDNs cache it corr
8383
| `/_og/d/**` (dynamic) | `public, max-age=<ttl>, s-maxage=<ttl>, immutable` |
8484
| `/_og/r/**` (resolver) | Same as dynamic |
8585

86-
Where `<ttl>`{lang="html"} is `cacheMaxAgeSeconds` (default 72 hours). URLs are content-addressed (encoded params + component hash), so `immutable` is safe; the response bytes never change for a given URL. No Nitro `swr`/`isr` route rule is needed (and it wouldn't work anyway, as `cachedEventHandler` JSON-serializes responses and breaks binary PNG/JPEG output).
86+
Where `<ttl>`{lang="html"} means `cacheMaxAgeSeconds` (default 72 hours). URLs use content addressing (encoded params + component hash), so `immutable` is safe; the response bytes never change for a given URL. You do not need a Nitro `swr`/`isr` route rule (and it wouldn't work anyway, as `cachedEventHandler` JSON-serializes responses and breaks binary PNG/JPEG output).
8787

8888
## Query Parameters
8989

@@ -95,7 +95,7 @@ OG image URLs encode all options in the **URL path**, not query parameters:
9595

9696
The cache key is deterministic from the path alone. Appending query parameters like `?ref=twitter` or `?utm_source=og` directly to an OG image URL has no effect on rendering. If you need different image variants, use a [custom cache key](#custom-cache-key).
9797

98-
Note that your **page URL's** query parameters (e.g., `/products?page=2`) are encoded into the generated OG image URL via the `_query` field. This means different page query strings produce different OG image URLs, since the page may render differently with different query params. Each unique combination gets its own cached image.
98+
Note that the generated OG image URL encodes your **page URL's** query parameters (e.g., `/products?page=2`) via the `_query` field. This means different page query strings produce different OG image URLs, since the page may render differently with different query params. Each unique combination gets its own cached image.
9999

100100
## Persistent Storage
101101

@@ -218,7 +218,7 @@ export default defineNuxtConfig({
218218

219219
Append `?purge` to any OG image URL to invalidate its internal cache entry and force a fresh render.
220220

221-
When [URL signing](/docs/og-image/guides/security#url-signing) is enabled, you must provide the signing secret as the purge value: `?purge=<your-secret>`{lang="html"}. This prevents unauthorized cache invalidation.
221+
When you enable [URL signing](/docs/og-image/guides/security#url-signing), you must provide the signing secret as the purge value: `?purge=<your-secret>`{lang="html"}. This prevents unauthorized cache invalidation.
222222

223223
Note that this only clears the module's internal Nitro storage cache (Layer 1). CDN edge caches (Layer 2) may continue serving the previous version until their TTL expires. To force CDN re-fetch:
224224

docs/content/4.api/0.define-og-image.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The emoji set to use when generating the image. Set to `false` to disable emoji
8282
### `html`
8383

8484
::deprecated
85-
The `html` option is deprecated and will be removed in the next major version due to SSRF risk. Use a Vue component instead. This option is disabled when `security.strict` is enabled.
85+
The `html` option is deprecated and the next major version will remove it due to SSRF risk. Use a Vue component instead. `security.strict` disables this option.
8686
::
8787

8888
- Type: `string`{lang="ts"}
@@ -109,7 +109,7 @@ The number of seconds to cache the image for. This is useful for reducing the nu
109109
- Type: `string`{lang="ts"}
110110
- Default: `undefined`{lang="ts"}
111111

112-
Custom cache key for this OG image. When set, this key is used directly for caching instead of the auto-generated key.
112+
Custom cache key for this OG image. When set, the module uses this key directly for caching instead of the auto-generated key.
113113

114114
### `key`
115115

docs/content/6.migration-guide/v6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Query parameters are no longer included in cache keys. Previously, `/page?foo=ba
302302

303303
See [PR #427](https://github.com/nuxt-modules/og-image/pull/427).
304304

305-
All image options are encoded in the URL path, so query parameters on the OG image URL have no effect. In v5, query parameter overrides (e.g. `?title=Override`) worked in production when URL signing was disabled. In v6, query param overrides are only available in dev and prerender modes. Use `defineOgImage` props to pass dynamic values instead.
305+
The URL path encodes all image options, so query parameters on the OG image URL have no effect. In v5, query parameter overrides (e.g. `?title=Override`) worked in production without URL signing. In v6, query param overrides only work in dev and prerender modes. Use `defineOgImage` props to pass dynamic values instead.
306306

307307
#### Cache Version Control
308308

examples/basic-satori/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"dependencies": {
1111
"@nuxt/fonts": "^0.14.0",
1212
"@resvg/resvg-js": "^2.6.2",
13-
"@tailwindcss/vite": "^4.2.4",
13+
"@tailwindcss/vite": "^4.3.0",
1414
"fontless": "^0.2.1",
15-
"nuxt": "^4.4.4",
15+
"nuxt": "^4.4.6",
1616
"nuxt-og-image": "latest",
1717
"nuxt-site-config": "^4.0.8",
1818
"satori": "^0.26.0",
19-
"tailwindcss": "^4.2.4",
20-
"vue": "^3.5.33"
19+
"tailwindcss": "^4.3.0",
20+
"vue": "^3.5.34"
2121
}
2222
}

examples/basic-takumi/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
},
1010
"dependencies": {
1111
"@nuxt/fonts": "^0.14.0",
12-
"@tailwindcss/vite": "^4.2.4",
13-
"@takumi-rs/core": "^1.1.2",
14-
"nuxt": "^4.4.4",
12+
"@tailwindcss/vite": "^4.3.0",
13+
"@takumi-rs/core": "^1.2.1",
14+
"nuxt": "^4.4.6",
1515
"nuxt-og-image": "latest",
1616
"nuxt-site-config": "^4.0.8",
17-
"tailwindcss": "^4.2.4",
18-
"vue": "^3.5.33"
17+
"tailwindcss": "^4.3.0",
18+
"vue": "^3.5.34"
1919
}
2020
}

examples/content/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
"preview": "nuxt preview"
99
},
1010
"dependencies": {
11-
"@nuxt/content": "^3.13.0",
11+
"@nuxt/content": "^3.14.0",
1212
"@nuxt/fonts": "^0.14.0",
1313
"@resvg/resvg-js": "^2.6.2",
14-
"@tailwindcss/vite": "^4.2.4",
14+
"@tailwindcss/vite": "^4.3.0",
1515
"fontless": "^0.2.1",
16-
"nuxt": "^4.4.4",
16+
"nuxt": "^4.4.6",
1717
"nuxt-og-image": "latest",
1818
"nuxt-site-config": "^4.0.8",
1919
"satori": "^0.26.0",
20-
"tailwindcss": "^4.2.4",
21-
"vue": "^3.5.33"
20+
"tailwindcss": "^4.3.0",
21+
"vue": "^3.5.34"
2222
}
2323
}

0 commit comments

Comments
 (0)