From d988921714f3335b9755e30ea893e3e2b47d72b6 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 11 Dec 2009 20:41:49 +0100 Subject: Added CustomPage. --- src/Text/Hakyll/Render.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/Text/Hakyll/Render.hs') diff --git a/src/Text/Hakyll/Render.hs b/src/Text/Hakyll/Render.hs index 8449180..ed888ed 100644 --- a/src/Text/Hakyll/Render.hs +++ b/src/Text/Hakyll/Render.hs @@ -40,12 +40,11 @@ writePage page = do makeDirectories destination B.writeFile destination (getBody page) -renderAndConcat :: FilePath -> [FilePath] -> IO B.ByteString -renderAndConcat templatePath paths = foldM concatRender' B.empty paths - where concatRender' :: B.ByteString -> FilePath -> IO B.ByteString - concatRender' chunk path = do - page <- readPage path - rendered <- render templatePath page +renderAndConcat :: Renderable a => FilePath -> [a] -> IO B.ByteString +renderAndConcat templatePath renderables = foldM concatRender' B.empty renderables + where concatRender' :: Renderable a => B.ByteString -> a -> IO B.ByteString + concatRender' chunk renderable = do + rendered <- render templatePath renderable let body = getBody rendered return $ B.append chunk $ body -- cgit v1.2.3