@@ -21,6 +21,7 @@ import Text.Hakyll.HakyllAction
2121import Text.Hakyll.Pandoc
2222import Text.Hakyll.Internal.Cache
2323import Text.Hakyll.Page
24+import Text.Hakyll.ContextManipulations
2425import Text.Hakyll.Internal.Template.Template
2526import Text.Hakyll.Internal.Template.Hamlet
2627
@@ -56,10 +57,9 @@ readTemplate path = do
5657 where
5758 fileName = "templates" </> path
5859 readDefaultTemplate = do
59− page <- unContext <$>
60− runHakyllAction (readPageAction path >>> renderAction)
61− let body = fromMaybe (error $ "No body in template " ++ fileName)
62− (M.lookup "body" page)
60+ body <- runHakyllAction $ readPageAction path
61+ >>> renderAction
62+ >>> takeBody
6363 return $ fromString body
6464
6565 readHamletTemplate = fromHamletRT <$> readHamletRT path