diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2009-12-11 20:41:49 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2009-12-11 20:41:49 +0100 |
commit | d988921714f3335b9755e30ea893e3e2b47d72b6 (patch) | |
tree | 873bbc9dc1f2b836c8f0b8973ce3fe34a9892b40 /src/Text/Hakyll/Render.hs | |
parent | d83791c106bf898e4397b592133642fbed5b8568 (diff) | |
download | hakyll-d988921714f3335b9755e30ea893e3e2b47d72b6.tar.gz |
Added CustomPage.
Diffstat (limited to 'src/Text/Hakyll/Render.hs')
-rw-r--r-- | src/Text/Hakyll/Render.hs | 11 |
1 files changed, 5 insertions, 6 deletions
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 |