diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-10-28 13:32:34 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-10-28 13:32:34 +0200 |
commit | 6b44cef123af6426a55838707586b6ac95f9db8b (patch) | |
tree | 40cadd8818bcdff1cc2650e489103d7a84041532 /src/Text/Hakyll/Internal | |
parent | 1f169dd0a0132464e74400e3c5625e8a30658a4c (diff) | |
download | hakyll-6b44cef123af6426a55838707586b6ac95f9db8b.tar.gz |
Add a takeBody function
Diffstat (limited to 'src/Text/Hakyll/Internal')
-rw-r--r-- | src/Text/Hakyll/Internal/Template.hs | 8 |
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 |