Repository navigation
fix(console): give marketing pages complete social preview tags - #56565
Conversation
There was a problem hiding this comment.
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" /> | |||
There was a problem hiding this comment.
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?
Why
Link previews for opencode.ai are inconsistent.
entry-server.tsxhard-codesog:imageandtwitter:imageon every page, so the homepage ships twoog:imagetags and/zengets the generic image ahead of its own. Every image URL is relative (/social-share.png), which several unfurlers don't resolve. Apart from/goand/black, no page setsog:title,og:description,og:urlortwitter:card, so X falls back to a small summary card or no card.What Changes
A
SocialMetacomponent sets the full Open Graph and Twitter card tags from the page's title, description, path and image, with absolute URLs:/social-share.png/zensocial-share-zen.png/go,/blacksocial-share-black.png/download,/enterprise,/brandsocial-share.pngog:urlfollows the page's locale (/de/download→https://opencode.ai/de/download). The hard-coded tags inentry-server.tsxare removed, so each page has exactly oneog:image.Verification
On the local dev server,
/,/zen,/go,/de/downloadand/brandeach have one absoluteog:image, the rightog:urlandtwitter:cardset tosummary_large_image.