OGMate.Renderer (OGMate v0.2.0)

Copy Markdown View Source

Default OG image renderer (1200×630).

Layout:

┌──────────────────────────────┐
│  [logo]  site_name           │  ← top-left, 80px padding
│                              │
│                              │
│                              │
│                              │
│                              │
│                              │
│  Title (72px bold)           │  ← bottom y = 470
│  Description (32px)          │  ← y = 500
└──────────────────────────────┘

Returns {:ok, png_binary} on success or {:error, reason} if any rendering step fails (font unavailable, image read failure, etc.).

Summary

Functions

Render title + description + logo + site_name into a 1200×630 PNG.

Functions

render(title, description, theme)

@spec render(String.t(), String.t(), OGMate.Theme.t()) ::
  {:ok, binary()} | {:error, term()}

Render title + description + logo + site_name into a 1200×630 PNG.

Returns {:ok, png_binary} on success, or {:error, reason} if any rendering step fails.