Social images autogenration
aka open graph β images, x/twitter card β images
Options
Basic idea is to create HTML or SVG βimageβ for page based on metadata, like title
, description
, tags
etc. And then convert it to 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 instruction for Astro OG Canvas β
Related
Further improvements
Current implementation looks boring. Maybe I can:
- generate gradient based on tag colors
- Some pages have βcoverβ images. Can I use it in social images? Though in my case all of them are SVGs
- It seems,
Astro OG Canvas
doesnβt support emojis - add logo