Skip to content

feat: default og:image so Slack link previews aren't blank - #319

Merged
calthejuggler merged 4 commits into
masterfrom
worktree-fix-og-images
Dec 1, 2026
Merged

calthejuggler merged 4 commits into
masterfrom
worktree-fix-og-images

Conversation

@calthejuggler

@calthejuggler calthejuggler commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Docusaurus adds twitter:card=summary_large_image to every page, but we never provided an image. Slack therefore reserved space for one and showed a grey placeholder. This PR adds a site-wide default image, and any doc can override it from its front matter.

 docusaurus.config.js
   themeConfig:
+    image: "img/og-default.png"     # -> og:image + twitter:image on every page

 static/img/
+└── og-default.png                  # 1200×630, coral logo + "ABsmartly Docs"
 AGENTS.md
+  ## Social previews                # default image + `image:` front-matter override

og-default.png

Evidence

  • Before: the live ownership-and-permissions page has a title and description, but no image:
    <meta name="twitter:card" content="summary_large_image">
    <meta property="og:title" content="The Ownership Model | The ABsmartly Docs">
    <meta property="og:description" content="Over the last few months ...">
    <!-- no og:image / twitter:image -->
    After: yarn build succeeds. Every one of the 414 built HTML pages has exactly one og:image, including the home page, normal docs, both API references and the 404 page:
    <meta property="og:image" content="https://docs.absmartly.com/img/og-default.png">
    <meta name="twitter:image" content="https://docs.absmartly.com/img/og-default.png">
    A doc with image: /img/logo.png in its front matter got og:image=https://docs.absmartly.com/img/logo.png instead. I tested this with a temporary edit and reverted it.

Merge Danger

Door: two-way

Reverting the config line removes the image. Slack caches previews, so links shared already keep their old card for a while.

Blast Radius: previews

Only page <head> tags change. The image URL is always the production one, so deploy-preview links won't show the image until this reaches production.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JHXkV558B45TtM6nkdMd6P

Summary by CodeRabbit

  • New Features
    • Social sharing previews now use a site-wide default image. Individual documentation pages can display a different preview image when one is specified.
  • Documentation
    • Added guidance on the default social preview image and how to set a page-specific image.

calthejuggler and others added 2 commits December 1, 2026 10:31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHXkV558B45TtM6nkdMd6P
Docusaurus emits twitter:card=summary_large_image on every page but we set
no image, so Slack and other unfurlers showed an empty image placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHXkV558B45TtM6nkdMd6P
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Docusaurus configuration sets img/og-default.png as the default social preview image. The documentation describes this site-wide setting and explains how page front matter can specify a preview image. It recommends dimensions of 1200 × 630 pixels.

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: Minimal · up to c1b43 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: a default og:image is added site-wide so link previews, such as those in Slack, are no longer blank. The raw summary confirms that docusaurus.config.js sets the defau…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: a default og:image is added site-wide so link previews, such as those in Slack, are no longer blank. The raw summary confirms that docusaurus.config.js sets the default social-sharing image to img/og-default.png, and AGENTS.md documents the preview image and per-page front-matter override. The title is specific, concise, and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the preview card,
With ears held high and whiskers bright.
A default image joins the page,
Front matter sets another right.
One hundred twenty by sixty-three,
A neat new picture hops in sight.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: c844d13e-6e44-4261-aa3f-409864f2648b
Commits

Reviewing files that changed from the base of the PR and between 65278ff and c1b4319.

Files selected for processing: 2

  • AGENTS.md
  • docusaurus.config.js
Files with no reviewable changes: 1

  • docusaurus.config.js

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@netlify

netlify Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for absmartly-docs ready!

Name Link
🔨 Latest commit c1b4319
🔍 Latest deploy log https://app.netlify.com/projects/absmartly-docs/deploys/6b0ea5e69401dffc0f36bd82
😎 Deploy Preview https://deploy-preview-319--absmartly-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

calthejuggler and others added 2 commits December 1, 2026 10:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHXkV558B45TtM6nkdMd6P
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JHXkV558B45TtM6nkdMd6P
@calthejuggler
calthejuggler merged commit dde6948 into master Dec 1, 2026
6 checks passed
@calthejuggler
calthejuggler deleted the worktree-fix-og-images branch December 1, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant