@@ -10,7 +10,7 @@ module Text.Hakyll.Render
1010 , css
1111 ) where
1212
13−import Control.Monad (unless, mapM, foldM)
13+import Control.Monad (unless, mapM)
1414
1515import System.Directory (copyFile)
1616import System.IO
@@ -64,14 +64,10 @@ renderAndConcatWith :: Renderable a
6464 -> FilePath
6565 -> [a]
6666 -> IO String
67−renderAndConcatWith manipulation templatePath renderables =
68− foldM concatRender' [] renderables
69− where
70− concatRender' :: Renderable a => String -> a -> IO String
71− concatRender' chunk renderable = do
72− rendered <- renderWith manipulation templatePath renderable
73− let body = getBody rendered
74− return $ chunk ++ body
67+renderAndConcatWith manipulation templatePath renderables = do
68+ template <- readFile templatePath
69+ contexts <- mapM toContext renderables
70+ return $ pureRenderAndConcatWith manipulation template contexts
7571
7672-- | Chain a render action for a page with a number of templates. This will
7773-- also write the result to the site destination. This is the preferred way