Repository navigation
feat(cards): left share card design, every-post cards and page-name og:title - #4
Merged
Merged
Conversation
…name og:title A site can now pick its share card design with appearance.shareCards: - design: 'centered' (the default, unchanged) or 'left'. The left design sets the site's logo and a trail of mono capitals on top (site, section, then the post's topic, "Topic" or "Author"), the headline and one support line, and a footer band with the byline and date or a post count on the left and the page's address on the right, on a sky of still stars. An author card shows the portrait, or an initial, in a circle. Text is fitted with satori's own measurements: a long title steps down from 64px to 48px, and support copy keeps whole sentences. It loads Inter 500/600/800 and JetBrains Mono 500/700 from fontsource, kept in R2 like Inter is today. - everyPost: posts and pages with a cover are shared with a drawn card too. The cover stays on the page and in its structured data; an ogImage set by hand still wins. The editor's share preview follows the setting. - home: the front page card's headline, a dimmer second line and its text. Shared pages now go by their own name: og:title is a post's ogTitle or title (its metaTitle stays in <title>), a topic's ogTitle or name, an author's name, and the front page's ogTitle, masthead title or site title. Before, topics and authors were shared as "Name - Site" by default. og:image:alt on drawn cards is the headline, then the support line, at most 420 characters. CARD_DESIGN goes to 2, so every card is drawn again under a new address. The Worker stays on satori 0.32: 0.33 loads HarfBuzz WebAssembly at import through fs or a script-relative fetch, which a Worker without nodejs_compat cannot do. 0.32 spaces a run's last letter from what follows, so the trail's word margins take that back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A post with no whole excerpt or description of its own gets its support line from the page's summary, which can end in an ellipsis where an import or the summary itself cut a sentence short. The card now keeps only the whole sentences before it, or shows no support line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A second share card design, picked per site, plus cards for every post and page-name
og:titletags.appearance.shareCardsTyped in
packages/core/src/types.ts(ShareCardSettings), stored with the other appearance settings, and edited in the admin under Settings, Appearance, Share cards: a design picker, the every-post switch and the front page card's three lines. Documented indocs/configuration.md.The left design (
packages/server/src/card-left.ts)ACME · BLOG. With no masthead title the trail is the site title and "Blog". Each card adds its own part: a post's primary topic,TOPICorAUTHOR.example.com/blog,example.com/blog/tag/news).fitCard). A long title steps down from 64px to 48px (two lines, three at 48px). Support copy keeps as many whole sentences as fit (three lines, two under a three-line title). Nothing is drawn under 28px. The centered design'sclip()is not used.everyPost
When on, every post and page is shared with a drawn card as
og:imageandtwitter:image, including pages with a cover image. The cover stays on the page and in its BlogPosting structured data. AnogImageset by hand on the post still wins. The editor's "When shared" preview follows the setting (/menow sayseveryPostCard).Tags around the cards
og:image:alton drawn cards isshareCardAlt(card): the headline, then the support line, capped at 420 characters.og:titleis the page's own name:ogTitle, else its title (metaTitlestays in<title>)ogTitle, else its nameogTitle, else the masthead title, else the site titleBefore, topics and authors were shared as "Name - Site" by default.
<title>keeps its suffix.CARD_DESIGNgoes to2, so every card (both designs) is drawn again under a new address.satori stays at 0.32
The design was drawn on satori 0.33.4. 0.33 imports HarfBuzz WebAssembly at module load, through
fsor a script-relative fetch, which a Worker withoutnodejs_compatcan't do. On 0.32 the only layout difference is that 0.32 spaces a run's last letter from what follows. The trail's word margins take that back, and a pixel comparison with the 0.33 reference renders shows the same line breaks, sizes and positions (left differences are glyph kerning, which 0.33 gets from HarfBuzz).Checks
bun run typecheck: cleanbun run --cwd packages/admin build: cleanbun scripts/leak-guard.ts(with the private denylist) andgitleaks: cleaneveryPoston there, every page lists a drawn card,twitter:imagematchesog:image, and topic and author pages are shared by name alone. The Worker draws each card in 1.4 to 3.5 s on first request; after that it is served from R2.shareCardsunset,renderSitelists the same card objects as before, under new keys only.🤖 Generated with Claude Code