No description
  • Rust 85.7%
  • Typst 12.9%
  • Dockerfile 1.4%
Find a file
2026-07-20 22:04:07 -04:00
assets add purpose meme 2025-08-03 18:06:26 -04:00
src it's dockerin time 2026-07-20 21:58:12 -04:00
template it's dockerin time 2026-07-20 21:58:12 -04:00
.dockerignore it's dockerin time 2026-07-20 21:58:12 -04:00
.gitignore init og 2025-07-21 13:24:42 -04:00
Cargo.lock update cargo lock 2026-07-20 22:00:44 -04:00
Cargo.toml it's dockerin time 2026-07-20 21:58:12 -04:00
docker-compose.yml update outside port 2026-07-20 22:04:07 -04:00
Dockerfile it's dockerin time 2026-07-20 21:58:12 -04:00
LICENSE make template for the image 2025-07-21 15:40:08 -04:00
README.md it's dockerin time 2026-07-20 21:58:12 -04:00
rust-toolchain.toml it's dockerin time 2026-07-20 21:58:12 -04:00
rustfmt.toml init og 2025-07-21 13:24:42 -04:00

━━━━━━ ❖ ━━━━━━

❖ Information

og exists to generate OpenGraph images for my blog.

The server bundles its Typst template, image assets, and Berkeley Mono fonts in the executable. It does not require a Typst installation or system fonts at runtime.

What is my purpose meme, but for og

Large parts of the code were taken directly from crates_io_og_image under the MIT License


❖ Usage

Run the server locally on its default port:

cargo run --release

Pass a different port as the sole argument if needed:

cargo run --release -- 4123

Generate an image with:

curl --get 'http://localhost:4000/generate' \
  --data-urlencode 'size=34' \
  --data-urlencode 'title=Shipping a self-contained OpenGraph service' \
  --data-urlencode 'website=blog.danshu.co' \
  --data-urlencode 'date=20 Jul 2026' \
  --output og.png

The title, website, and date parameters are limited to 200, 255, and 64 Unicode characters respectively. Requests that exceed a limit return HTTP 400.

Logs are controlled with RUST_LOG and default to informational output:

RUST_LOG=debug cargo run --release

To build and run the service with Docker Compose:

docker compose up --build

The container exposes the service at http://localhost:4000 and contains no external Typst executable or font installation.


❖ What's New?

0.5.0 - Big Docker Time