Tags
Tags: meta
Now that there’s enough content posted to at least make their presence useful, if far from necessary, I’ve added tags to my posts. So that this metadata is not just treated as more data, I’ve made the corresponding changes to the hakyll site generator and templates. You can, for example, see all the posts I made concerning statistics laid out in a list.
Most of functionality is already there in the Hakyll.Web.Tags module, but integrating it is a bit complicated. I followed Javran’s extremely clear tutorial, with only two minor changes1.
I also added a tag cloud visualization to the home page. I don’t feel like taking a didactic approach now, but it essentially just requires using the same tags <- buildTags "posts/*" (fromCapture "tags/*.html")
statement to grab the tags, adding the field tagCloudField "tag-cloud" 80 125 tags
2 to indexCtx
, and putting the $tag-cloud$
template code where the cloud is to be interpolated.
In
templates/post.html
, I place date, author, and tag info in the samediv
. In thesite.hs
, I used the statementlet postCtxTagged = postCtxWithTags tags
for historical reasons.↩The magic constants
80
and125
are the range of font sizes for the tags, in percent. This maintains bioequivalence with not resizing them at all.↩