Recent work plotting graphs with SwifUI from a command line app revived my interest to use a similar mechanism for rendering social media previes for SPI package pages (or others, like blog, documentation, search etc).
This is a proof of concept that consists of a tiny Hummingbird server which uses SwiftUI to render social media previews and returns them when queried on an endpoint:
curl "http://localhost:8080/social-preview?owner=apple&repository=swift&description=A%20powerful%20and%20intuitive%20programming%20language." -o out.png
To do:
- Improve rendering for different content sizes
- Consider adding more information
- Add a redis cache