Social images autogeneration
Aka Open Graph β images and X/Twitter Card β images.
Options
The basic idea is to create an HTML or SVG βimageβ for a page based on metadata, such as title
, description
, tags
, etc. Then, convert it to a raster image. There are several options:
- Satori β
- CanvasKit - Skia β
- resvg-js β
- Headless browsers
Satori
- Example in astro-theme-cactus β
- Example in astro-paper β
CanvasKit
Installation
Full instructions for Astro OG Canvas β
Related
Further Improvements
The current implementation looks boring. Maybe I can:
- Generate a gradient based on tag colors
- Use βcoverβ images from some pages in social images, although all of them are SVGs
- It seems that
Astro OG Canvas
doesnβt support emojis - Add a logo