What is YOCaml
YOCaml is a framework used to describe build systems in OCaml, released under GPL3 license, with an API suited for creating static site generators. Unlike Hugo, Jekyll or Zola, which provide a CLI, YOCaml is closer to Hakyll, as it imposes no structure, requiring you to build your generator step by step. This offers the opportunity to create diverse projects such as a personal blog, a personal wiki, more experimental sites, a webring or even this documentation website.
Written in OCaml
YOCaml is, as its name suggests, written in the wonderful language OCaml, a programming language that is statically typed (with type inference), functional, imperative, and object-oriented, and that features a rich module system. While the simplest reason we wrote YOCaml in OCaml is probably that we like OCaml, the language’s grammatical and conceptual flexibility made it easier to design an API that we find expressive. In addition, OCaml is a high-performance language with a rich ecosystem — if you want to convince yourself to use OCaml, we invite you to read Why I chose OCaml as my primary language.
Adhering to the ecosystem
YOCaml was designed in a very modular way, allowing us to take advantage of the OCaml ecosystem. As a result, even though YOCaml is packaged with a set of standard plugins, the core API makes it fairly easy to integrate other libraries. For example, users have requested support for Gemtext, in order to serve their site over Gemini. No changes were required in YOCaml’s core, demonstrating its flexibility.
Easy deployment
One of the great strengths of statically generated sites is that they are very easy to deploy. In fact, a simple static server is enough! However, YOCaml goes further: thanks to the Mirage project, it is possible to directly generate documents using a Git repository as a file system (compatible with GitHub Pages) and serve them statically. For example, by using Unipi, you can build an operating system (unikernel) designed to statically serve your site with great ease!