diff options
Diffstat (limited to 'examples/simpleblog')
-rw-r--r-- | examples/simpleblog/hakyll.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/simpleblog/hakyll.hs b/examples/simpleblog/hakyll.hs index 75173f8..38472d5 100644 --- a/examples/simpleblog/hakyll.hs +++ b/examples/simpleblog/hakyll.hs @@ -6,7 +6,7 @@ import Text.Hakyll.Context import Text.Hakyll.File (getRecursiveContents, directory) import Text.Hakyll.CreateContext (createPage, createCustomPage, createListing) import Data.List (sort) -import Control.Monad (mapM_, liftM) +import Control.Monad (forM_, liftM) import Control.Monad.Reader (liftIO) import Data.Either (Either(..)) @@ -19,14 +19,17 @@ main = hakyll "http://example.com" $ do let postPages = map createPage postPaths -- Render index, including recent posts. - let index = createListing "index.html" ["templates/postitem.html"] (take 3 postPages) [("title", Left "Home")] + let index = createListing "index.html" ["templates/postitem.html"] + (take 3 postPages) [("title", Left "Home")] renderChain ["index.html", "templates/default.html"] index -- Render all posts list. - let posts = createListing "posts.html" ["templates/postitem.html"] postPages [("title", Left "All posts")] + let posts = createListing "posts.html" ["templates/postitem.html"] + postPages [("title", Left "All posts")] renderChain ["posts.html", "templates/default.html"] posts -- Render all posts. liftIO $ putStrLn "Generating posts..." - mapM_ (renderChain ["templates/post.html", "templates/default.html"]) postPages - + forM_ postPages $ renderChain [ "templates/post.html" + , "templates/default.html" + ] |