Skip to content

Commit 37008af

Browse files
Document og:dynamic:logo-color and add conflicts/precedence note
Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
1 parent 90b1776 commit 37008af

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ tags: ["seo", "configuration", "docs.yml"]
77
Dynamic OG images have a new layout with more content and fine-grained control:
88

99
- **Section title** derived from the page's navigation breadcrumb, styled with your accent color
10+
- **Page title** clamped to two lines with ellipsis
1011
- **Page description** extracted from frontmatter, clamped to two lines
1112
- **Page URL** displayed below the description
1213
- **Dark mode default** with a subtle accent gradient overlay
14+
- **Logo variant selection** with the new `og:dynamic:logo-color` setting (`dark` or `light`)
15+
- **Color overrides** for text and background
1316
- **Toggle flags** to show or hide individual elements (logo, section, description, URL, gradient)
1417

1518
```yaml docs.yml
1619
metadata:
1720
og:dynamic: true
1821
og:dynamic:text-color: "#1a1a1a"
1922
og:dynamic:background-color: "#ffffff"
23+
og:dynamic:logo-color: dark
2024
og:dynamic:show-logo: true
2125
og:dynamic:show-section: true
2226
og:dynamic:show-description: true

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ metadata:
115115
og:background-image: ./images/og-background.png # optional
116116
og:dynamic:text-color: "#1a1a1a" # optional
117117
og:dynamic:background-color: "#ffffff" # optional
118+
og:dynamic:logo-color: dark # optional, dark | light
118119
og:dynamic:show-logo: true # optional
119120
og:dynamic:show-section: true # optional
120121
og:dynamic:show-description: true # optional
@@ -138,6 +139,10 @@ metadata:
138139
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.
139140
</ParamField>
140141

142+
<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.
144+
</ParamField>
145+
141146
<ParamField path="metadata.og:dynamic:show-logo" type="boolean" required={false} default={true} toc={true}>
142147
Toggle visibility of the logo in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
143148
</ParamField>
@@ -158,6 +163,16 @@ metadata:
158163
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.
159164
</ParamField>
160165

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+
161176
### Twitter / X
162177

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

fern/snippets/seo-metadata-site.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ metadata:
1919
og:background-image: "https://developer.squareup.com/images/og-background.png"
2020
og:dynamic:text-color: "#1a1a1a"
2121
og:dynamic:background-color: "#ffffff"
22+
og:dynamic:logo-color: dark
2223
og:dynamic:show-logo: true
2324
og:dynamic:show-section: true
2425
og:dynamic:show-description: true
@@ -110,6 +111,10 @@ metadata:
110111
Override the background color for dynamically generated OG images. Accepts any valid CSS color value.
111112
</ParamField>
112113

114+
<ParamField path="metadata.og:dynamic:logo-color" type="enum" required={false}>
115+
Choose which logo variant (`dark` or `light`) to render in dynamically generated OG images. Defaults to `dark`.
116+
</ParamField>
117+
113118
<ParamField path="metadata.og:dynamic:show-logo" type="boolean" required={false}>
114119
Toggle visibility of the logo in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
115120
</ParamField>

0 commit comments

Comments
 (0)