There’s no code today. Just lots and lots of words. Code will follow soon!
What is not documented is how to combine the two. Part 1 of this series describes my Apache configuration for serving content from the two parts of the web site. After figuring that out, the most difficult challenge was making the two parts of the sites look and feel as if they were part of a single coherent site. The single biggest complexity is that both frameworks employ different templating systems by default. Yesod employs Shakespearean templates, specifically Hamlet, Lucius and Cassius. Hakyll has its own straightforward, but effective, system. I enumerate some of the interesting characteristics below:
Both systems have their pros and cons. However, on a personal note, I have a soft spot for Hamlet’s syntax. However, I don’t object to using real HTML. Ultimately, the question came down to the following: do I adapt my Yesod app to consume Hakyll templates or do I adapt my Hakyll site generator to handle the templates from my Yesod app. Given my unwillingness to compromise the type safety of my Yesod app, I decided to do the latter.
There were three main approaches I considered:
wgetand then use that to render the static site
I toyed with the first approach briefly and then decided that this was not personally very satisfying. Both Yesod and Hakyll are highly modular and configurable frameworks, so I decided to power through things and simply use the
shakespeare in my Hakyll app.
As I’ll describe in future instalments of this series, this was not entirely straightforward, but did ultimately result in a reasonably elegant solution to the problem.
Content © 2010–2021 Richard Cook. All rights reserved.