summaryrefslogtreecommitdiff
path: root/examples/rssblog/hakyll.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-15 19:07:53 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-03-15 19:07:53 +0100
commite358894df10ce2106acf3df560ce94ac03e03e5f (patch)
tree1f700d5626e8d1ed9237ae68e32063325a12364a /examples/rssblog/hakyll.hs
parent47586163d2c38aa32ef4c106ebceca9fbf67325a (diff)
downloadhakyll-e358894df10ce2106acf3df560ce94ac03e03e5f.tar.gz
Migrated rssblog example to feedblog.
Diffstat (limited to 'examples/rssblog/hakyll.hs')
-rw-r--r--examples/rssblog/hakyll.hs34
1 files changed, 0 insertions, 34 deletions
diff --git a/examples/rssblog/hakyll.hs b/examples/rssblog/hakyll.hs
deleted file mode 100644
index 50970f8..0000000
--- a/examples/rssblog/hakyll.hs
+++ /dev/null
@@ -1,34 +0,0 @@
-module Main where
-
-import Control.Monad.Reader (liftIO)
-import Text.Hakyll (hakyll)
-import Text.Hakyll.Render (renderAndConcat, renderChain, css)
-import Text.Hakyll.File (getRecursiveContents, directory)
-import Text.Hakyll.Renderables (createPagePath, createCustomPage, createListing)
-import Data.List (sort)
-import Control.Monad (mapM_, liftM)
-import Data.Either (Either(..))
-
-main = hakyll $ do
- -- Static directory.
- directory css "css"
-
- -- Find all post paths.
- postPaths <- liftM (reverse . sort) $ getRecursiveContents "posts"
- let renderablePosts = map createPagePath postPaths
-
- -- Render index, including recent posts.
- let index = createListing "index.html" "templates/postitem.html" (take 3 renderablePosts) [("title", "Home")]
- renderChain ["index.html", "templates/default.html"] index
-
- -- Render all posts list.
- let posts = createListing "posts.html" "templates/postitem.html" renderablePosts [("title", "All posts")]
- renderChain ["posts.html", "templates/default.html"] posts
-
- -- Render all posts.
- liftIO $ putStrLn "Generating posts..."
- mapM_ (renderChain ["templates/post.html", "templates/default.html"]) renderablePosts
-
- -- Render rss feed
- let rss = createListing "rss.xml" "templates/rssitem.xml" (take 3 renderablePosts) []
- renderChain ["templates/rss.xml"] rss