From 4f335aa6a2ffcd663c4bdb2c139bf4e1ea5237bf Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 29 Jan 2010 15:16:08 +0100 Subject: Added categoryblog example. --- examples/tagblog/hakyll.hs | 12 +++--------- examples/tagblog/templates/rss.xml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'examples/tagblog') diff --git a/examples/tagblog/hakyll.hs b/examples/tagblog/hakyll.hs index 03dd488..c51007f 100644 --- a/examples/tagblog/hakyll.hs +++ b/examples/tagblog/hakyll.hs @@ -4,7 +4,7 @@ import Text.Hakyll (hakyll) import Text.Hakyll.Render import Text.Hakyll.Tags (readTagMap, renderTagCloud, renderTagLinks) import Text.Hakyll.File (getRecursiveContents, directory, removeSpaces) -import Text.Hakyll.Renderables (createPagePath, createCustomPage, createListingWith) +import Text.Hakyll.Renderables (createPagePath, createCustomPage, createListingWith, createListing) import Text.Hakyll.Context (ContextManipulation, renderDate) import Data.List (sort) import Data.Map (toList) @@ -46,14 +46,8 @@ main = hakyll $ do ]) renderablePosts -- Render rss feed - let recentRSSItems = renderAndConcat ["templates/rssitem.xml"] $ take 3 renderablePosts - let rssPage = createCustomPage "rss.xml" - ("templates/postitem.html" : take 3 postPaths) - [("items", Right recentRSSItems)] - renderChain ["templates/rss.xml"] rssPage - - -- Render index. - renderChain ["templates/default.html"] $ createPagePath "index.html" + let rss = createListing "rss.xml" "templates/rssitem.xml" (take 3 renderablePosts) [] + renderChain ["templates/rss.xml"] rss where postManipulation :: ContextManipulation postManipulation = renderDate "date" "%B %e, %Y" "Date unknown" diff --git a/examples/tagblog/templates/rss.xml b/examples/tagblog/templates/rss.xml index be918af..1217b4e 100644 --- a/examples/tagblog/templates/rss.xml +++ b/examples/tagblog/templates/rss.xml @@ -4,6 +4,6 @@ The SimpleBlog http://example.com Simple blog in hakyll - $items + $body -- cgit v1.2.3