Skip to content

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

Installation

Full instructions for Astro OG Canvas β†—

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