From d205f96825d73e0ad7efc97a321333dacfbf9e0c Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Thu, 28 Jan 2010 15:26:20 +0100 Subject: Updated documentation and examples. --- examples/simpleblog/hakyll.hs | 10 +++------- examples/simpleblog/index.html | 2 +- examples/simpleblog/posts.html | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) (limited to 'examples/simpleblog') diff --git a/examples/simpleblog/hakyll.hs b/examples/simpleblog/hakyll.hs index bdcb3fe..8b53215 100644 --- a/examples/simpleblog/hakyll.hs +++ b/examples/simpleblog/hakyll.hs @@ -4,7 +4,7 @@ import Text.Hakyll (hakyll) import Text.Hakyll.Render import Text.Hakyll.Context import Text.Hakyll.File (getRecursiveContents, directory) -import Text.Hakyll.Renderables (createPagePath, createCustomPage) +import Text.Hakyll.Renderables (createPagePath, createCustomPage, createListing) import Data.List (sort) import Control.Monad (mapM_, liftM) import Control.Monad.Reader (liftIO) @@ -19,16 +19,12 @@ main = hakyll $ do let renderablePosts = map createPagePath postPaths -- Render index, including recent posts. - 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)] + createListing "index.html" "templates/postitem.html" (take 3 renderablePosts) [("title", "Home")] -- Render all posts list. - 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)] + createListing "posts.html" "templates/postitem.html" renderablePosts [("title", "All posts")] -- Render all posts. liftIO $ putStrLn "Generating posts..." diff --git a/examples/simpleblog/index.html b/examples/simpleblog/index.html index 201cc18..88cc0a2 100644 --- a/examples/simpleblog/index.html +++ b/examples/simpleblog/index.html @@ -1,7 +1,7 @@

Recent posts

All posts...
diff --git a/examples/simpleblog/posts.html b/examples/simpleblog/posts.html index bc1741b..7db1a59 100644 --- a/examples/simpleblog/posts.html +++ b/examples/simpleblog/posts.html @@ -1,4 +1,4 @@

All posts

-- cgit v1.2.3