Skip to content

fix(console): give marketing pages complete social preview tags - #56565

Merged
kitlangton merged 1 commit into
devfrom
social-preview-tags
Oct 17, 2026
Merged

kitlangton merged 1 commit into
devfrom
social-preview-tags

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Link previews for opencode.ai are inconsistent. entry-server.tsx hard-codes og:image and twitter:image on every page, so the homepage ships two og:image tags and /zen gets the generic image ahead of its own. Every image URL is relative (/social-share.png), which several unfurlers don't resolve. Apart from /go and /black, no page sets og:title, og:description, og:url or twitter:card, so X falls back to a small summary card or no card.

What Changes

A SocialMeta component sets the full Open Graph and Twitter card tags from the page's title, description, path and image, with absolute URLs:

Page Image Title / description
/ social-share.png home title, site description
/zen social-share-zen.png Zen title, Zen hero copy
/go, /black social-share-black.png unchanged copy, now through the component
/download, /enterprise, /brand social-share.png page title and meta description (new)

og:url follows the page's locale (/de/download → https://opencode.ai/de/download). The hard-coded tags in entry-server.tsx are removed, so each page has exactly one og:image.

Verification

cd packages/console/app && bun run typecheck
bunx vite dev --port 5199
curl -s http://[::1]:5199/zen | grep -o '<meta[^>]*\(og:\|twitter:\)[^>]*>'

On the local dev server, /, /zen, /go, /de/download and /brand each have one absolute og:image, the right og:url and twitter:card set to summary_large_image.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described for the pages it touches. On the PR's dev server, /, /zen, /go, /black, /de/download and /brand each have exactly one absolute og:image, the right locale-aware og:url and summary_large_image. Typecheck passes.

Public API is unchanged: this only affects meta tags on the console marketing site.

One regression worth fixing: removing the global tags from entry-server.tsx leaves pages without SocialMeta with no preview image at all (see inline comment).

@@ -17,8 +17,6 @@ export default createHandler(
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the global og:image/twitter:image gone, pages that don't render SocialMeta now have no preview image at all. I checked /changelog and /legal/privacy-policy on the dev server: no og:/twitter: tags. Before, they got /social-share.png. /legal/terms-of-service and the 404 page lose it the same way. Could you add SocialMeta to the changelog and legal pages too, or keep an absolute site-wide default that a page's own tags replace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant