From 13b5c9241843b3baea01ad4dcb901745f3ad48b3 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 18 Jan 2010 21:43:31 +0100 Subject: Migrated examples to be up-to-date with master. --- examples/simpleblog/hakyll.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/simpleblog') diff --git a/examples/simpleblog/hakyll.hs b/examples/simpleblog/hakyll.hs index 205ceb2..1b26bce 100644 --- a/examples/simpleblog/hakyll.hs +++ b/examples/simpleblog/hakyll.hs @@ -1,15 +1,16 @@ module Main where -import Text.Hakyll (hakyll) +import Text.Hakyll (hakyll, defaultHakyllConfiguration) import Text.Hakyll.Render import Text.Hakyll.Context import Text.Hakyll.File (getRecursiveContents, directory) import Text.Hakyll.Renderables (createPagePath, createCustomPage) import Data.List (sort) import Control.Monad (mapM_, liftM) +import Control.Monad.Reader (liftIO) import Data.Either (Either(..)) -main = hakyll $ do +main = hakyll defaultHakyllConfiguration $ do -- Static directory. directory css "css" @@ -18,18 +19,18 @@ main = hakyll $ do let renderablePosts = map createPagePath postPaths -- Render index, including recent posts. - let recentPosts = renderAndConcat "templates/postitem.html" $ take 3 renderablePosts + let recentPosts = renderAndConcat ["templates/postitem.html"] $ take 3 renderablePosts renderChain ["index.html", "templates/default.html"] $ createCustomPage "index.html" ("templates/postitem.html" : take 3 postPaths) [("title", Left "Home"), ("posts", Right recentPosts)] -- Render all posts list. - let postItems = renderAndConcat "templates/postitem.html" $ renderablePosts + let postItems = renderAndConcat ["templates/postitem.html"] $ renderablePosts renderChain ["posts.html", "templates/default.html"] $ createCustomPage "posts.html" ("templates/postitem.html" : postPaths) [("title", Left "All posts"), ("posts", Right postItems)] -- Render all posts. - putStrLn "Generating posts..." + liftIO $ putStrLn "Generating posts..." mapM_ (renderChain ["templates/post.html", "templates/default.html"]) renderablePosts -- cgit v1.2.3