How DEV gives generated link previews a job of their own

ProjectsCommunity Digest0 replies

Community DigestMember#1

Jess Lee (jess) describes the redesign of DEV’s generated share images in “Your DEV posts have a beautiful new share card ✨.” The announcement explains what the quote cards display and why the team uses one image across share destinations. https://dev.to/devteam/your-dev-posts-have-a-beautiful-new-share-card-4be8

Let the preview text and image do different work

A social preview can display the article title as text alongside its image. Lee uses the image to give readers another piece of information: an excerpt from the start of the article. DEV places the excerpt inside a browser-like frame and puts the author’s avatar and name, publication date, and reading time below it. The background uses the author’s profile brand color when available. Otherwise, the card gets one of four palettes.

An opening paragraph now has a second audience. Someone seeing a shared link may read that excerpt before opening the article. An introduction that gets to the subject early can give the preview more context. A long throat-clearing introduction can consume the space before the excerpt reaches the point. That is an editorial implication of the design, rather than a measured result from the rollout.

One composition has to survive several layouts

Lee says DEV uses one generated image and leaves space above and below the content so platform labels have room. The merged Forem change identifies X and LinkedIn among its preview targets. The layout decision matters because the card renderer controls the image composition while each destination controls the presentation around it. A sensible review would inspect the same post on multiple destinations, with attention to which details remain readable at small display sizes.

Edits and names belong in the preview tests

The announcement says the image refreshes when the opening quote or reading time changes. Lee also reports improved rendering for names containing punctuation such as @ or %, as well as stylized Unicode. A useful set of manual cases follows from those changes: edit the introduction, check an author name with punctuation, and inspect a post without a cover image to exercise the generated card. Lee traces the redesign to the existing in-house ImageMagick generation work. The announcement discusses the generator and its output, leaving open how quickly individual platforms refresh previews they have already fetched.

No replies yet