summaryrefslogtreecommitdiff
path: root/examples/simpleblog
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/simpleblog
parent31476dd6b8d30c62153ec8f6dabce4509b57516c (diff)
downloadhakyll-13b5c9241843b3baea01ad4dcb901745f3ad48b3.tar.gz
Migrated examples to be up-to-date with master.
Diffstat (limited to 'examples/simpleblog')
-rw-r--r--examples/simpleblog/hakyll.hs11
1 files changed, 6 insertions, 5 deletions
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