diff options
-rw-r--r-- | examples/rssblog/hakyll.hs | 13 | ||||
-rw-r--r-- | examples/simpleblog/hakyll.hs | 11 | ||||
-rw-r--r-- | examples/tagblog/hakyll.hs | 10 |
3 files changed, 18 insertions, 16 deletions
diff --git a/examples/rssblog/hakyll.hs b/examples/rssblog/hakyll.hs index a0984c8..581da9e 100644 --- a/examples/rssblog/hakyll.hs +++ b/examples/rssblog/hakyll.hs @@ -1,6 +1,7 @@ module Main where -import Text.Hakyll (hakyll) +import Control.Monad.Reader (liftIO) +import Text.Hakyll (hakyll, defaultHakyllConfiguration) import Text.Hakyll.Render (renderAndConcat, renderChain, css) import Text.Hakyll.File (getRecursiveContents, directory) import Text.Hakyll.Renderables (createPagePath, createCustomPage) @@ -8,7 +9,7 @@ import Data.List (sort) import Control.Monad (mapM_, liftM) import Data.Either (Either(..)) -main = hakyll $ do +main = hakyll defaultHakyllConfiguration $ do -- Static directory. directory css "css" @@ -17,23 +18,23 @@ 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 -- Render rss feed - let recentRSSItems = renderAndConcat "templates/rssitem.xml" $ take 3 renderablePosts + let recentRSSItems = renderAndConcat ["templates/rssitem.xml"] $ take 3 renderablePosts let rssPage = createCustomPage "rss.xml" ("templates/postitem.html" : take 3 postPaths) [("items", Right recentRSSItems)] 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 diff --git a/examples/tagblog/hakyll.hs b/examples/tagblog/hakyll.hs index d30da26..b9a01eb 100644 --- a/examples/tagblog/hakyll.hs +++ b/examples/tagblog/hakyll.hs @@ -1,6 +1,6 @@ module Main where -import Text.Hakyll (hakyll) +import Text.Hakyll (hakyll, defaultHakyllConfiguration) import Text.Hakyll.Render import Text.Hakyll.Tags (readTagMap, renderTagCloud, renderTagLinks) import Text.Hakyll.File (getRecursiveContents, directory, removeSpaces) @@ -11,7 +11,7 @@ import Data.Map (toList) import Control.Monad (mapM_, liftM) import Data.Either (Either(..)) -main = hakyll $ do +main = hakyll defaultHakyllConfiguration $ do -- Static directory. directory css "css" @@ -31,7 +31,7 @@ main = hakyll $ do -- Render index, including recent posts. let recentPosts = renderAndConcatWith postManipulation - "templates/postitem.html" + ["templates/postitem.html"] (take 3 renderablePosts) renderChain ["index.html", "templates/default.html"] $ createCustomPage "index.html" ("templates/postitem.html" : take 3 postPaths) @@ -45,7 +45,7 @@ main = hakyll $ do ]) renderablePosts -- Render rss feed - let recentRSSItems = renderAndConcat "templates/rssitem.xml" $ take 3 renderablePosts + let recentRSSItems = renderAndConcat ["templates/rssitem.xml"] $ take 3 renderablePosts let rssPage = createCustomPage "rss.xml" ("templates/postitem.html" : take 3 postPaths) [("items", Right recentRSSItems)] @@ -62,7 +62,7 @@ main = hakyll $ do renderPostList url title posts = do let postItems = renderAndConcatWith postManipulation - "templates/postitem.html" + ["templates/postitem.html"] (map createPagePath posts) customPage = createCustomPage url ("templates/postitem.html" : posts) |