-
Notifications
You must be signed in to change notification settings - Fork 649
Add OpenGraph image generation crate #11436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
2ad5ff2
to
c45d09f
Compare
hmmmmm..... looks like the PNG snapshot tests aren't quite as portable as I had hoped... 😅 |
89a3ca7
to
507f0b2
Compare
I take that back. The issue was caused by the CI machines not having the Fira Sans font pre-installed. I've added that to the CI workflow now and it seems that CI is happy with it 🎉 |
Great new edition using modern tooling – love to see it! Having fun talking about this in the Typst discord :) |
This makes the crate more secure while maintaining the same functionality, and it simplifies the implementation by removing the intermediate template rendering step.
This allows `typst compile template/og-image.typ --input 'data={"name":"foo","version":"1.0.0"}'` to work too.
Add step to download and install Fira Sans font in CI environment to ensure consistent font rendering between local development and GitHub Actions. This fixes the PNG snapshot test failures caused by font fallback differences.
632a58f
to
3365621
Compare
cb9e431
to
078d523
Compare
This PR adds a new
crates_io_og_image
crate that generates OpenGraph images for crates.io packages using the Typst typesetting system.Features
(more screenshots available in the snapshots folder in the diff view 😉)
The generated images are used for social media previews when crates.io links are shared.
Note that the crate is not integrated into the main crates.io application yet. This will be done in a follow-up pull request.