ogcards
Generate Open Graph cards for a static site at build time. Give it a JSON manifest and a TOML theme, and it writes one PNG per card with Pillow. No headless browser, no Node, no system libraries, just Pillow.
It's framework-agnostic, so any generator that can write a JSON file can drive it.
Install
uv tool install ogcards
Usage
ogcards init # writes a sample ogcards.toml and og-manifest.json
ogcards build --config ogcards.toml --manifest og-manifest.json --out-dir _site
ogcards preview --title "Hello" --subtitle "June 2026" --out card.png
build is incremental, so a card re-renders only when its title, subtitle,
template, or theme changes. Pass --force to rebuild everything.
Inputs
Two files. The theme (ogcards.toml) is your branding. The manifest
(og-manifest.json) is the per-build content your generator emits.
[canvas]
width = 1200
height = 630
background = "#ffffff"
[templates.post]
title_size = 64 # shrinks automatically past max_title_lines
title_color = "#1a1a1a"
meta_color = "#535358"
accent = "#0645ad"
padding = 80
max_title_lines = 3
{
"cards": [
{
"title": "Your Post Title",
"subtitle": "June 11, 2026",
"out": "assets/og/posts/your-post.png"
}
]
}
out is relative to --out-dir, and a card's template defaults to post.
Static sites
Have your generator write og-manifest.json at build time, run ogcards build,
then point each og:image at the out path. See examples/jekyll/
for a Jekyll manifest; the pattern is the same for Hugo or Eleventy.
License
MIT. See LICENSE.
Release files for ogcards 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ogcards-0.2.0.tar.gz | 569.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ogcards-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / ogcards-0.2.0.tar.gz
| Download URL | ogcards-0.2.0.tar.gz |
|---|---|
| Size | 569.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9531136ad298a2d696a264e91fc51239ab081ab16655c7f415be9e8da24b56a
|
|
BLAKE2b-256 checksum How to use checksums |
2eaf783c7196cd41283dbde848e9a551759d56d448efe701f5b83f37b4bc0e5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.
Transparency logRelease files / ogcards-0.2.0-py3-none-any.whl
| Download URL | ogcards-0.2.0-py3-none-any.whl |
|---|---|
| Size | 547.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8513dec1084763a4f70f7f4454abf55b33ae1030d0c704b34b001cd14f1a8617
|
|
BLAKE2b-256 checksum How to use checksums |
a9f2d9f61a49ae23341ef3c5e68b21e38c1786b17e7321cb863d14dcac823804
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 14, 2026.
Transparency log