Hakyll with Github Pages (a simple approach)

Posted on December 16, 2016

In general, tutorials for many static site generators with hosting on Github Pages will recommend the “two-branch” method. Hakyll makes this recommendation in their tutorials. The method uses a single repository with the markup source and the rendered site on separate branches. There isn’t anything inherently terrible about this method, but at least for me, I never really liked the workflow with that setup.

Multiple branches just didn’t work for me

Switching branches gets in the way of active work, stashing work in progress sometimes fails, and it feels weird/cumbersome to have different files existing on different branches.

A (simple) alternative

It was some time before the obvious alternative presented itself…

Two repos - one is for the site source, one has the rendered content Github Pages will host.

Having used it for a few months, I realize how lean and straightforward this alternative is (for me). I like the workflow, it’s a little less mental strain, and I don’t mind making two commits to publish updates.