Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ogcards-0.1.0.tar.gz (442.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ogcards-0.1.0-py3-none-any.whl (416.9 kB view details)

Uploaded Python 3

File details

Details for the file ogcards-0.1.0.tar.gz.

File metadata

  • Download URL: ogcards-0.1.0.tar.gz
  • Upload date:
  • Size: 442.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ogcards-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32d93c6cc6ba40efad0d52acf72772862e954005aa182a0266ed7595284ef4bc
MD5 7be6e7ce8d07131cfd77962bf5345053
BLAKE2b-256 2f7c6c9b0bb4f346a05bc69060269a28b4f375128fc281325784c48a5a16c066

See more details on using hashes here.

Provenance

The following attestation bundles were made for ogcards-0.1.0.tar.gz:

Publisher: publish.yml on laplacef/ogcards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ogcards-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ogcards-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 416.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ogcards-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa8aa1acccb287fa0cb1a2ad56970b681b015da63369451794a1857770b68448
MD5 803dba83045ed969ad21c069c5f277af
BLAKE2b-256 7af297bcc69239d16c449eaaf645c58e1fed77874edad905e945e4dbc7621401

See more details on using hashes here.

Provenance

The following attestation bundles were made for ogcards-0.1.0-py3-none-any.whl:

Publisher: publish.yml on laplacef/ogcards

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page