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.2.0.tar.gz (569.9 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.2.0-py3-none-any.whl (547.7 kB view details)

Uploaded Python 3

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

Hashes for ogcards-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b9531136ad298a2d696a264e91fc51239ab081ab16655c7f415be9e8da24b56a
MD5 8bd945aebd4435a3642de521372a0645
BLAKE2b-256 2eaf783c7196cd41283dbde848e9a551759d56d448efe701f5b83f37b4bc0e5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ogcards-0.2.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.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

Hashes for ogcards-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8513dec1084763a4f70f7f4454abf55b33ae1030d0c704b34b001cd14f1a8617
MD5 9380aea5ec8d16a2a9c8a8a439af866e
BLAKE2b-256 a9f2d9f61a49ae23341ef3c5e68b21e38c1786b17e7321cb863d14dcac823804

See more details on using hashes here.

Provenance

The following attestation bundles were made for ogcards-0.2.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