Developer builds portrait Bluesky summary cards in Python using Playwright, no APIs
A developer created a Python script called generate-summary.py to produce 1080×1350 portrait images for Bluesky link previews, replacing the standard 1200×630 landscape format used on other platforms. The tool reads a custom YAML frontmatter block called summary_data from each article, which defines a headline, optional visual elements, and a tagline. Three layout types are supported — a comparison card grid, a pipeline flow, and a stats row — with only one rendered per article depending on which key is present. Playwright Chromium screenshots an inline HTML template at exact pixel dimensions, requiring no external image APIs or third-party services. The script also applies HTML escaping to prevent injection issues, treating highlighted text spans as a controlled exception via regex parsing.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in