Jordan's blog / My Experience with Hakyll so far... link
Mon, Sep 15, 2014

I’ve since moved onto Hugo for all my Gitit wiki+blog needs, for reason’s stated in the linked blog. It’s quite awesome so far!

I’ve come to love Hakyll for it’s simplicity, even if I’m utterly lost when it comes to anything more than the templates and route compiling. At the very least, my experience with it over the past few weeks has greatly increased my HTML/CSS abilities.

For example, I’ve built this site’s theme pretty much from scratch, built off the base Hakyll template!
The Tags functionality is pulled from here, while the really fancy responsive sidebar-to-header functionality is pulled from the Hyde Jekyll theme.

The color scheme is based on the wonderful, widely available Solarized color scheme.

My favorite part of the blogging workflow I’ve got setup now is that this blog feeds off my Gitit pages, and auto-publishes new posts whenever I create a new entry in the blog directory. I made this collaboration slightly more seamless with the following patch, which simply turns Gitit’s categories metadata tag into tags, so Hakyll detects and tags posts out of the box; This likely could have been done with Hakyll’s own config, but I couldn’t figure it out.

Here’s that patch:

--- a/Network/Gitit/Page.hs 2014-09-07 10:23:30.942018917 -0500
+++ b/Network/Gitit/Page.hs        2014-09-07 10:27:52.580674830 -0500
@@ -120,7 +120,7 @@
     where (pt, lhs) = parsePageType val
 adjustPage ("toc", val) page' = page' {
   pageTOC = map toLower val `elem` ["yes","true"] }
-adjustPage ("categories", val) page' =
+adjustPage ("tags", val) page' =
    page' { pageCategories = splitCategories val ++ pageCategories page' }
 adjustPage (_, _) page' = page'
 
@@ -136,7 +136,7 @@
       pagecats   = pageCategories page'
       metadata   = filter
                        (\(k, _) -> not (k `elem`
-                           ["title", "format", "toc", "categories"]))
+                           ["title", "format", "toc", "tags"]))
                        (pageMeta page')
       metadata'  = (if pagename /= pagetitle
                        then "title: " ++ pagetitle ++ "\n"
@@ -152,7 +152,7 @@
                             (if pagetoc then "yes" else "no") ++ "\n"
                        else "") ++
                    (if not (null pagecats)
-                       then "categories: " ++ intercalate ", " pagecats ++ "\n"
+                       then "tags: " ++ intercalate ", " pagecats ++ "\n"
                        else "") ++
                    (unlines (map (\(k, v) -> k ++ ": " ++ v) metadata))
   in (if null metadata' then "" else "---\n" ++ metadata' ++ "...\n\n")
@@ -172,7 +172,7 @@
                      rest <- hGetLinesTill h dotline
                      let (md,_) = parseMetadata $ unlines $ "---":rest
                      return $ splitCategories $ fromMaybe ""
-                            $ lookup "categories" md
+                            $ lookup "tags" md
                    else return [])
        (\e -> if isEOFError e then return [] else E.throwIO e)