- Rust 85.7%
- Typst 12.9%
- Dockerfile 1.4%
| assets | ||
| src | ||
| template | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
━━━━━━ ❖ ━━━━━━
❖ 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.
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
