[codex] Add content-rich link preview images#45
Open
tin-computer[bot] wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This changes pasted with.md share links from a generic brand preview image to a generated preview image that shows the shared document title and a compact excerpt from the markdown content.
What changed
/og/s/[shareId]and repository shares at/og/r/[token]./s/[shareId]and/r/[token]metadata so Open Graph and Twitter previews use the share-specific title, description, and image route.X-Robots-Tag: noindex, nofollow, noarchiveto the generated image responses.Why
When people paste a with.md link today, the preview image is the same static
/with-md.jpgeverywhere. That makes share links feel generic and hides the document context. The new preview shows the actual title and enough content to make the link recognizable before someone opens it.Validation
npm --workspace web run test -- link-previewnpm --workspace web run testnpm --workspace web run build/og/s/test-previewand/og/r/test-preview: both returned200 OK,content-type: image/png,x-robots-tag: noindex, nofollow, noarchive, and 1200x630 PNG output.Notes
next/ogbuilds cleanly that way in this app.