@@ -1,6 +1,7 @@
11module Main where
22
3−import Text.Hakyll (hakyll)
3+import Control.Monad.Reader (liftIO)
4+import Text.Hakyll (hakyll, defaultHakyllConfiguration)
45import Text.Hakyll.Render (renderAndConcat, renderChain, css)
56import Text.Hakyll.File (getRecursiveContents, directory)
67import Text.Hakyll.Renderables (createPagePath, createCustomPage)
@@ -8,7 +9,7 @@ import Data.List (sort)
89import Control.Monad (mapM_, liftM)
910import Data.Either (Either(..))
1011
11−main = hakyll $ do
12+main = hakyll defaultHakyllConfiguration $ do
1213 -- Static directory.
1314 directory css "css"
1415
@@ -17,23 +18,23 @@ main = hakyll $ do
1718 let renderablePosts = map createPagePath postPaths
1819
1920 -- Render index, including recent posts.
20− let recentPosts = renderAndConcat "templates/postitem.html" $ take 3 renderablePosts
21+ let recentPosts = renderAndConcat ["templates/postitem.html"] $ take 3 renderablePosts
2122 renderChain ["index.html", "templates/default.html"] $
2223 createCustomPage "index.html" ("templates/postitem.html" : take 3 postPaths)
2324 [("title", Left "Home"), ("posts", Right recentPosts)]
2425
2526 -- Render all posts list.
26− let postItems = renderAndConcat "templates/postitem.html" $ renderablePosts
27+ let postItems = renderAndConcat ["templates/postitem.html"] $ renderablePosts
2728 renderChain ["posts.html", "templates/default.html"] $
2829 createCustomPage "posts.html" ("templates/postitem.html" : postPaths)
2930 [("title", Left "All posts"), ("posts", Right postItems)]
3031
3132 -- Render all posts.
32− putStrLn "Generating posts..."
33+ liftIO $ putStrLn "Generating posts..."
3334 mapM_ (renderChain ["templates/post.html", "templates/default.html"]) renderablePosts
3435
3536 -- Render rss feed
36− let recentRSSItems = renderAndConcat "templates/rssitem.xml" $ take 3 renderablePosts
37+ let recentRSSItems = renderAndConcat ["templates/rssitem.xml"] $ take 3 renderablePosts
3738 let rssPage = createCustomPage "rss.xml"
3839 ("templates/postitem.html" : take 3 postPaths)
3940 [("items", Right recentRSSItems)]