applyTemplate :: Template Compiler String -- ^ Blaze template
              -> Context String           -- ^ Hakyll context
              -> Item String              -- ^ The item
              -> Compiler (Item String)   -- ^ Resulting HTML
applyTemplate tpl ctx item =
    tpl ctx' item
    >>= return . renderHtml
    >>= \body -> return $ itemSetBody body item
  where
    ctx' :: String -> Compiler String
    ctx' key = unContext (ctx `mappend` missingField) key item
applyTemplate :: Template Compiler String -- ^ Blaze template
              -> Context String           -- ^ Hakyll context
              -> Item String              -- ^ The item
              -> Compiler (Item String)
applyTemplate tpl ctx item =
    tpl ctx' item
    >>= return . renderHtml
    >>= \body -> return $ itemSetBody body item
  where
    ctx' :: String -> Compiler String
    ctx' key = unContext (ctx `mappend` missingField) key item
applyTemplate tpl ctx item =
    tpl ctx' item
    >>= return . renderHtml
    >>= \body -> return $ itemSetBody body item
  where
    ctx' :: String -> Compiler String
    ctx' key = unContext (ctx `mappend` missingField) key item