Building this Site
This website is created with a hand-rolled static site generator. In this series I'll talk about some of the infrastructure I've built towards making the website.
Infrastructure
My static site generator asite
, is primarily programmed in OCaml, using Dune and OPAM for the build system. The templating language used is custom, as is the majority of steps in the site building process. I do use a number of external packages:
- cmarkit — blog posts are written in markdown,
asite
usescmarkit
to render the markdown into HTML. - hilite — for code syntax highlighting, though this isn't a complete solution, more on this in future posts.
- js_of_ocaml, search — used in building the search page, more on this in the future.
- markup — when generating rss,
markup
is used to parse and process a blog post's HTML into just a teaser, to keep the size of the rss file small. - subprocess — used to invoke
esbuild
as a step in the build process, more on this in future posts. - yaml — blog posts and other pages have a YAML frontmatter containing "columns" in the "post database".
- alcotest, cmdliner, logs, re, timedesc, and yojson — miscellaneous low level utilities used all over the place.
OCaml Environment
I first learned OCaml in my undergrad Programming Languages course and liked it enough to use it for my Senior project. As a result, I know how painful it used to be to build OCaml programs 14 years ago. I was pleasantly surprised when I picked OCaml back up for this project, just how nice the system feels now. Dune + OPAM made it possible to get a working project with a dependency up and running in a few minutes.
More to come!