summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r--src/Text/Hakyll/Internal/Template.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Hakyll/Internal/Template.hs b/src/Text/Hakyll/Internal/Template.hs
index 59235cc..cd6a3bd 100644
--- a/src/Text/Hakyll/Internal/Template.hs
+++ b/src/Text/Hakyll/Internal/Template.hs
@@ -21,6 +21,7 @@ import Text.Hakyll.HakyllAction
import Text.Hakyll.Pandoc
import Text.Hakyll.Internal.Cache
import Text.Hakyll.Page
+import Text.Hakyll.ContextManipulations
import Text.Hakyll.Internal.Template.Template
import Text.Hakyll.Internal.Template.Hamlet
@@ -56,10 +57,9 @@ readTemplate path = do
where
fileName = "templates" </> path
readDefaultTemplate = do
- page <- unContext <$>
- runHakyllAction (readPageAction path >>> renderAction)
- let body = fromMaybe (error $ "No body in template " ++ fileName)
- (M.lookup "body" page)
+ body <- runHakyllAction $ readPageAction path
+ >>> renderAction
+ >>> takeBody
return $ fromString body
readHamletTemplate = fromHamletRT <$> readHamletRT path