Skip to content

Commit 046d3e8

Browse files
Add toggle flags documentation and update changelog for OG image redesign
Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
1 parent 2549233 commit 046d3e8

3 files changed

Lines changed: 63 additions & 2 deletions

File tree

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
tags: ["seo", "configuration", "docs.yml"]
33
---
44

5-
## Dynamic OG image color overrides <Availability type="beta" /> [#og-color-overrides]
5+
## Redesigned dynamic OG images <Availability type="beta" /> [#og-image-redesign]
66

7-
Control the text and background colors of dynamically generated OG images. Set `og:dynamic:text-color` and `og:dynamic:background-color` in your `docs.yml` metadata to override the auto-detected theme colors. This is useful when your site has a light background where the default white text is hard to read.
7+
Dynamic OG images have a new layout with more content and fine-grained control:
8+
9+
- **Section title** derived from the page's navigation breadcrumb, styled with your accent color
10+
- **Page description** extracted from frontmatter, clamped to two lines
11+
- **Page URL** displayed below the description
12+
- **Dark mode default** with a subtle accent gradient overlay
13+
- **Toggle flags** to show or hide individual elements (logo, section, description, URL, gradient)
814

915
```yaml docs.yml
1016
metadata:
1117
og:dynamic: true
1218
og:dynamic:text-color: "#1a1a1a"
1319
og:dynamic:background-color: "#ffffff"
20+
og:dynamic:show-logo: true
21+
og:dynamic:show-section: true
22+
og:dynamic:show-description: true
23+
og:dynamic:show-url: true
24+
og:dynamic:show-gradient: true
1425
```
1526
1627
<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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ metadata:
116116
og:background-image: ./images/og-background.png # optional
117117
og:dynamic:text-color: "#1a1a1a" # optional
118118
og:dynamic:background-color: "#ffffff" # optional
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
119124
```
120125

121126
<ParamField path="metadata.og:dynamic" type="boolean" required={false} default={false} toc={true}>
@@ -134,6 +139,26 @@ metadata:
134139
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.
135140
</ParamField>
136141

142+
<ParamField path="metadata.og:dynamic:show-logo" type="boolean" required={false} default={true} toc={true}>
143+
Toggle visibility of the logo in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
144+
</ParamField>
145+
146+
<ParamField path="metadata.og:dynamic:show-section" type="boolean" required={false} default={true} toc={true}>
147+
Toggle visibility of the section title in dynamically generated OG images. The section title is derived from the page's navigation breadcrumb. Defaults to `true` when `og:dynamic` is enabled.
148+
</ParamField>
149+
150+
<ParamField path="metadata.og:dynamic:show-description" type="boolean" required={false} default={true} toc={true}>
151+
Toggle visibility of the page description in dynamically generated OG images. The description is extracted from the page's frontmatter (`description`, `subtitle`, or `excerpt`). Defaults to `true` when `og:dynamic` is enabled.
152+
</ParamField>
153+
154+
<ParamField path="metadata.og:dynamic:show-url" type="boolean" required={false} default={true} toc={true}>
155+
Toggle visibility of the page URL in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
156+
</ParamField>
157+
158+
<ParamField path="metadata.og:dynamic:show-gradient" type="boolean" required={false} default={true} toc={true}>
159+
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.
160+
</ParamField>
161+
137162
### Twitter / X
138163

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

fern/snippets/seo-metadata-site.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ 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:show-logo: true
23+
og:dynamic:show-section: true
24+
og:dynamic:show-description: true
25+
og:dynamic:show-url: true
26+
og:dynamic:show-gradient: true
2227

2328
# Twitter/X
2429
twitter:title: "Square Developer Platform Documentation"
@@ -105,6 +110,26 @@ metadata:
105110
Override the background color for dynamically generated OG images. Accepts any valid CSS color value.
106111
</ParamField>
107112

113+
<ParamField path="metadata.og:dynamic:show-logo" type="boolean" required={false}>
114+
Toggle visibility of the logo in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
115+
</ParamField>
116+
117+
<ParamField path="metadata.og:dynamic:show-section" type="boolean" required={false}>
118+
Toggle visibility of the section title in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
119+
</ParamField>
120+
121+
<ParamField path="metadata.og:dynamic:show-description" type="boolean" required={false}>
122+
Toggle visibility of the page description in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
123+
</ParamField>
124+
125+
<ParamField path="metadata.og:dynamic:show-url" type="boolean" required={false}>
126+
Toggle visibility of the page URL in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
127+
</ParamField>
128+
129+
<ParamField path="metadata.og:dynamic:show-gradient" type="boolean" required={false}>
130+
Toggle visibility of the accent gradient overlay in dynamically generated OG images. Defaults to `true` when `og:dynamic` is enabled.
131+
</ParamField>
132+
108133
<ParamField path="metadata.canonical-host" type="string" required={false}>
109134
The host of your documentation website. This will be used to set the canonical URL for metadata tags and documents like the sitemap.
110135

0 commit comments

Comments
 (0)