diff options
| author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-30 19:25:22 +0200 |
|---|---|---|
| committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-03-30 19:25:22 +0200 |
| commit | 622c259708503eb9eb766fe0b00c28b979e2e653 (patch) | |
| tree | 8289d95ab3afca4b7540f8207800c1e37db5ffdd /examples/feedblog | |
| parent | 82931dd6661221f1d138f2de5af0668e9080ef26 (diff) | |
| download | hakyll-622c259708503eb9eb766fe0b00c28b979e2e653.tar.gz | |
Adapted examples to general style guide.
Because I thought the examples should follow the same style
guidelines as the Hakyll code itself, I adapted them to it.
Diffstat (limited to 'examples/feedblog')
| -rw-r--r-- | examples/feedblog/hakyll.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/feedblog/hakyll.hs b/examples/feedblog/hakyll.hs index c8633a9..e261c0e 100644 --- a/examples/feedblog/hakyll.hs +++ b/examples/feedblog/hakyll.hs @@ -9,7 +9,7 @@ import Text.Hakyll.CreateContext (createPage, createCustomPage, createListing) import Text.Hakyll.ContextManipulations (copyValue) import Text.Hakyll.Feed (FeedConfiguration (..), renderRss) import Data.List (sort) -import Control.Monad (mapM_, liftM) +import Control.Monad (forM_, liftM) import Control.Monad.Reader (liftIO) import Data.Either (Either(..)) @@ -22,16 +22,20 @@ 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" + ] -- Render RSS feed. renderRss myFeedConfiguration $ |
