OG Images
Links:
- https://og-playground.vercel.app/
- https://edge-runtime.vercel.app/cli
- https://vercel.com/docs/concepts/functions/edge-functions/og-image-api
- https://vercel.com/docs/concepts/functions/edge-functions/edge-functions-api
Posts get a card generated by /api/og, drawn over the header img or
og.backgroundImage. To use a ready-made 1200×630 image instead, put it next to
the post and point og.image at it.
For a looping video card, put a 1200×630 mp4 at public/content/<slug>/og.mp4
and point og.video at it. The OG image is its still frame.
og:
image: ./og.webp
video: /content/my-post/og.mp4
This post has one. Share it on Discord or X to see it loop.
It emits og:video for Discord, Telegram, and iMessage. X needs a
twitter:site handle for player cards. X_HANDLE in src/lib/siteMeta.tsx
ships as the template author’s, so replace it with your own handle, or set it to
undefined to drop twitter:site and keep summary_large_image. With a
handle, posts with a video also get an X player card that loops it on a
generated /og/player/<post>/ page.
You can test your social cards with
- Facebook Sharing Debugger — https://developers.facebook.com/tools/debug/
- Twitter Card Validator — https://cards-dev.twitter.com/validator
- Image Preview doesn’t work there anymore, so I’m using Bannerbear’s Twitter Card Preview Tool