diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-28 15:26:20 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-28 15:26:20 +0100 |
commit | d205f96825d73e0ad7efc97a321333dacfbf9e0c (patch) | |
tree | 136eb2cf15d5a1bb2675a5bfb0631f24477e6ea0 /examples/simpleblog | |
parent | 3f5df5ea59a904cb8b14703667b10053f9651f50 (diff) | |
download | hakyll-d205f96825d73e0ad7efc97a321333dacfbf9e0c.tar.gz |
Updated documentation and examples.
Diffstat (limited to 'examples/simpleblog')
-rw-r--r-- | examples/simpleblog/hakyll.hs | 10 | ||||
-rw-r--r-- | examples/simpleblog/index.html | 2 | ||||
-rw-r--r-- | examples/simpleblog/posts.html | 2 |
3 files changed, 5 insertions, 9 deletions
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 @@ <div id="posts"> <h1>Recent posts</h1> <ul> - $posts + $body </ul> <a href="$root/posts.html">All posts...</a> </div> 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 @@ <h1>All posts</h1> <ul> - $posts + $body </ul> |