Add share cards
-
Put the font files you want on cards in the site, for example
_assets/fonts/Inter-Bold.ttf. The same files can serve your CSS. -
Add the
wraphelper from Defaults and globals to_globals.jsx. -
Create
_outputs/card.png.jsx, returning a 1200×630<svg>like the example in Share cards, withfont-family="Inter". -
Point the root layout's
<head>at it:{page.outputs?.card && <meta property="og:image" content={`${page.siteURL}${page.outputs.card}`} />} -
With
taragen serverunning, open/about.card.pngin the browser. Each save reloads it, so you can tune the layout by eye.
If a page should share a different image, set outputs: { card: false } and
write your own og:image tag for it.