summaryrefslogtreecommitdiff
path: root/examples/rssblog
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 21:43:31 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-18 21:43:31 +0100
commit13b5c9241843b3baea01ad4dcb901745f3ad48b3 (patch)
tree9d9c6cc3e5356ce06a35714f15bef5c1c8f39e64 /examples/rssblog
parent31476dd6b8d30c62153ec8f6dabce4509b57516c (diff)
downloadhakyll-13b5c9241843b3baea01ad4dcb901745f3ad48b3.tar.gz
Migrated examples to be up-to-date with master.
Diffstat (limited to 'examples/rssblog')
-rw-r--r--examples/rssblog/hakyll.hs13
1 files changed, 7 insertions, 6 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)]