Skip to content

Commit 88fe33c

Browse files
committed
clarify text + structure
1 parent 37008af commit 88fe33c

3 files changed

Lines changed: 22 additions & 56 deletions

File tree

fern/products/docs/pages/changelog/2026-03-17.mdx

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
tags: ["seo", "configuration", "docs.yml"]
3+
---
4+
5+
## Redesigned dynamic OG images
6+
7+
Dynamic OG images have a new layout with fine-grained control over the logo variant, text and background colors, and which elements appear (section, description, URL, gradient).
8+
9+
```yaml docs.yml
10+
metadata:
11+
og:dynamic: true
12+
og:background-image: ./images/og-background.png
13+
```
14+
15+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/seo/setting-seo-metadata#dynamic-og-images">Read the docs</Button>

fern/products/docs/pages/seo/metadata.mdx

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ The image displayed when your docs are shared on LinkedIn, Slack, Discord, and o
9292
</ParamField>
9393

9494
<ParamField path="metadata.og:image:width" type="number" required={false} toc={true}>
95-
The width of your Open Graph image in pixels.
95+
The width of your Open Graph image in pixels. Only applied when `og:image` is set.
9696
</ParamField>
9797

9898
<ParamField path="metadata.og:image:height" type="number" required={false} toc={true}>
99-
The height of your Open Graph image in pixels.
99+
The height of your Open Graph image in pixels. Only applied when `og:image` is set.
100100
</ParamField>
101101

102102
<ParamField path="metadata.og:logo" type="string" required={false} toc={true}>
@@ -105,42 +105,34 @@ The image displayed when your docs are shared on LinkedIn, Slack, Discord, and o
105105

106106
### Dynamic OG images <Availability type="beta" /> [#dynamic-og-images]
107107

108-
Instead of using a single static image for all pages, you can enable dynamic OG image generation. When enabled, Fern automatically generates a unique `og:image` for each page that doesn't have one [set in frontmatter](#open-graph).
108+
Instead of using a single static image for all pages, you can enable dynamic OG image generation. When enabled, Fern automatically generates a unique `og:image` for each page that doesn't have one [set in frontmatter](#open-graph). The `og:dynamic:*` sub-settings and `og:background-image` below are only read when `og:dynamic: true` — they are ignored otherwise. `fern check` surfaces warnings for conflicting settings so you can resolve them locally.
109109

110110
You can optionally provide a custom background image (`og:background-image`) for dynamically generated OG images.
111111

112112
```yaml docs.yml
113113
metadata:
114114
og:dynamic: true
115-
og:background-image: ./images/og-background.png # optional
116-
og:dynamic:text-color: "#1a1a1a" # optional
117-
og:dynamic:background-color: "#ffffff" # optional
118-
og:dynamic:logo-color: dark # optional, dark | light
119-
og:dynamic:show-logo: true # optional
120-
og:dynamic:show-section: true # optional
121-
og:dynamic:show-description: true # optional
122-
og:dynamic:show-url: true # optional
123-
og:dynamic:show-gradient: true # optional
115+
og:background-image: ./images/og-background.png
124116
```
125117

126118
<ParamField path="metadata.og:dynamic" type="boolean" required={false} default={false} toc={true}>
127-
When `true`, enables dynamic OG image generation for pages that don't have a custom `og:image` set.
119+
When `true`, enables dynamic OG image generation for pages that don't have a custom `og:image` set. Any site-wide `og:image` and `twitter:image` still apply to the homepage; every other page uses the dynamically generated image.
128120
</ParamField>
129121

130122
<ParamField path="metadata.og:background-image" type="string" required={false} toc={true}>
131123
A custom background image for dynamically generated OG images. Can be a URL or a relative file path. Relative paths are resolved from the YAML file where this property is set (e.g., `docs.yml`). When set, this image is used as the background instead of a solid color.
132124
</ParamField>
133125

134126
<ParamField path="metadata.og:dynamic:text-color" type="string" required={false} toc={true}>
135-
Override the text color for dynamically generated OG images. Accepts any valid CSS color value (e.g., `"#1a1a1a"`). By default, Fern auto-detects the text color from your site's theme. Use this when the auto-detected color doesn't contrast well with your background.
127+
Override the text color for dynamically generated OG images. Accepts any valid CSS color value (e.g., `"#1a1a1a"`). By default, Fern auto-detects the text color from your site's theme. Use this when the auto-detected color doesn't contrast well with your background. Must differ from `og:dynamic:background-color` so the text remains visible.
136128
</ParamField>
137129

138130
<ParamField path="metadata.og:dynamic:background-color" type="string" required={false} toc={true}>
139131
Override the background color for dynamically generated OG images. Accepts any valid CSS color value (e.g., `"#ffffff"`). By default, Fern uses your site's theme background color.
140132
</ParamField>
141133

142134
<ParamField path="metadata.og:dynamic:logo-color" type="enum" required={false} default="dark" toc={true}>
143-
Choose which logo variant to render in dynamically generated OG images. Accepts `dark` or `light`, matching the corresponding entry under the top-level [`logo:` setting](/learn/docs/getting-started/global-configuration#logo-configuration) in your `docs.yml`. Defaults to `dark`. If your `docs.yml` only defines one logo variant, that variant is used regardless of this setting.
135+
Choose which logo variant to render in dynamically generated OG images. Accepts `dark` or `light`, matching the corresponding entry under the top-level [`logo:` setting](/learn/docs/getting-started/global-configuration#logo-configuration) in your `docs.yml`. If your `docs.yml` only defines one logo variant, that variant is used regardless of this setting. Has no effect when `og:dynamic:show-logo: false`.
144136
</ParamField>
145137

146138
<ParamField path="metadata.og:dynamic:show-logo" type="boolean" required={false} default={true} toc={true}>
@@ -163,16 +155,6 @@ metadata:
163155
Toggle visibility of the accent gradient overlay in dynamically generated OG images. The gradient uses your accent color. Defaults to `true` when `og:dynamic` is enabled.
164156
</ParamField>
165157

166-
#### Conflicts and precedence
167-
168-
When `og:dynamic: true`, the following interactions apply. `fern check` surfaces warnings for each conflict so you can resolve them locally.
169-
170-
- `og:image` and `twitter:image` only apply to the homepage. Every other page uses the dynamically generated image.
171-
- `og:dynamic:*` sub-settings and `og:background-image` are only read when `og:dynamic: true`. If dynamic generation is off, they are ignored.
172-
- `og:dynamic:logo-color` has no effect when `og:dynamic:show-logo: false`.
173-
- `og:image:width` and `og:image:height` are only used alongside `og:image`. Setting them without `og:image` is a no-op.
174-
- `og:dynamic:text-color` must differ from `og:dynamic:background-color`, otherwise the text becomes invisible.
175-
176158
### Twitter / X
177159

178160
Controls how your docs appear in Twitter Card previews when shared on X.

0 commit comments

Comments
 (0)