Build-time Open Graph card generator for any static site. Manifest in, PNGs out, one dependency.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogcards-0.2.0.tar.gz.
File metadata
- Download URL: ogcards-0.2.0.tar.gz
- Upload date:
- Size: 569.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9531136ad298a2d696a264e91fc51239ab081ab16655c7f415be9e8da24b56a
|
|
| MD5 |
8bd945aebd4435a3642de521372a0645
|
|
| BLAKE2b-256 |
2eaf783c7196cd41283dbde848e9a551759d56d448efe701f5b83f37b4bc0e5d
|
Provenance
The following attestation bundles were made for ogcards-0.2.0.tar.gz:
Publisher:
publish.yml on laplacef/ogcards
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ogcards-0.2.0.tar.gz -
Subject digest:
b9531136ad298a2d696a264e91fc51239ab081ab16655c7f415be9e8da24b56a - Sigstore transparency entry: 1813377466
- Sigstore integration time:
-
Permalink:
laplacef/ogcards@9cf23130ecb6ddb1458c25a86a30f0ec927a61af -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/laplacef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9cf23130ecb6ddb1458c25a86a30f0ec927a61af -
Trigger Event:
push
-
Statement type:
File details
Details for the file ogcards-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ogcards-0.2.0-py3-none-any.whl
- Upload date:
- Size: 547.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8513dec1084763a4f70f7f4454abf55b33ae1030d0c704b34b001cd14f1a8617
|
|
| MD5 |
9380aea5ec8d16a2a9c8a8a439af866e
|
|
| BLAKE2b-256 |
a9f2d9f61a49ae23341ef3c5e68b21e38c1786b17e7321cb863d14dcac823804
|
Provenance
The following attestation bundles were made for ogcards-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on laplacef/ogcards
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ogcards-0.2.0-py3-none-any.whl -
Subject digest:
8513dec1084763a4f70f7f4454abf55b33ae1030d0c704b34b001cd14f1a8617 - Sigstore transparency entry: 1813377773
- Sigstore integration time:
-
Permalink:
laplacef/ogcards@9cf23130ecb6ddb1458c25a86a30f0ec927a61af -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/laplacef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9cf23130ecb6ddb1458c25a86a30f0ec927a61af -
Trigger Event:
push
-
Statement type: