Spec: Written ahead of the package. Not in 7.0.0-alpha.0: og7.0.0-alpha.0
Share image
The 1200 × 630 picture a shared link shows, drawn from the page's title and description, or the Product record, in the page's Theme.
og(page, { theme }) draws the share image of a page: 1200 by 630 pixels, as an SVG string and as a PNG. The page's meta.image points at the file, and renderPage writes the share tags from it.
What it draws
| Part | From |
|---|---|
| The Brand | The nav section's brand: its mark and its text |
| The title | The page's title, at most 64 characters, so it sets in two lines at most |
| The line beneath | The page's description, cut at a word to two lines |
| The paint | The Theme: its paper, ink, accent, display typeface and divider policy |
| The address | meta.canonical, less its scheme |
For a product, og(product) draws from the Product record in place of a page: its name, its summary and its Theme.
How it maps
The head half ships today. A record with a meta.image of a URL, a width and a height renders the og:image and twitter:image tags. Document and head traces each tag to its field. The image itself is drawn by hand.