@@ -40,12 +40,11 @@ writePage page = do
4040 makeDirectories destination
4141 B.writeFile destination (getBody page)
4242
43−renderAndConcat :: FilePath -> [FilePath] -> IO B.ByteString
44−renderAndConcat templatePath paths = foldM concatRender' B.empty paths
45− where concatRender' :: B.ByteString -> FilePath -> IO B.ByteString
46− concatRender' chunk path = do
47− page <- readPage path
48− rendered <- render templatePath page
43+renderAndConcat :: Renderable a => FilePath -> [a] -> IO B.ByteString
44+renderAndConcat templatePath renderables = foldM concatRender' B.empty renderables
45+ where concatRender' :: Renderable a => B.ByteString -> a -> IO B.ByteString
46+ concatRender' chunk renderable = do
47+ rendered <- render templatePath renderable
4948 let body = getBody rendered
5049 return $ B.append chunk $ body
5150