blog
May 7, 2026 · View on GitHub
My first personal blog using YOCaml, an OCaml static site generator.
Requirements
Setup
Create a local switch and install dependencies:
opam switch create . 5.3.0 --deps-only --with-dev-setup
eval $(opam env)
Build
dune build
Run
dune exec blog
Project layout
.
├── assets/
│ ├── css/ # stylesheets
│ ├── images/ # static images
│ └── templates/ # page templates
├── content/
│ ├── articles/ # blog posts
│ └── pages/ # standalone pages
├── bin/
│ ├── blog.ml # entry point
│ └── dune
├── blog.opam
└── dune-project
OG image
The social-preview image is rasterized from assets/og-default.svg to
_www/images/og-default.png at build time via rsvg-convert (see
bin/blog.ml). The Yocaml cache only re-runs the conversion when the SVG
changes.
librsvg must be on PATH:
brew install librsvg # macOS
apt-get install librsvg2-bin # Debian/Ubuntu (CI)
License
MIT — Benjamin Thuillier