summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Internal
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-28 13:32:34 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-28 13:32:34 +0200
commit6b44cef123af6426a55838707586b6ac95f9db8b (patch)
tree40cadd8818bcdff1cc2650e489103d7a84041532 /src/Text/Hakyll/Internal
parent1f169dd0a0132464e74400e3c5625e8a30658a4c (diff)
downloadhakyll-6b44cef123af6426a55838707586b6ac95f9db8b.tar.gz
Add a takeBody function
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