summaryrefslogtreecommitdiff
path: root/examples/tagblog
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-29 15:16:08 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-29 15:16:08 +0100
commit4f335aa6a2ffcd663c4bdb2c139bf4e1ea5237bf (patch)
tree2a20cb81317ca50d2666684ed50b5047b568f467 /examples/tagblog
parent8ff702589fb5a1a2e600b204970084466de58a09 (diff)
downloadhakyll-4f335aa6a2ffcd663c4bdb2c139bf4e1ea5237bf.tar.gz
Added categoryblog example.
Diffstat (limited to 'examples/tagblog')
-rw-r--r--examples/tagblog/hakyll.hs12
-rw-r--r--examples/tagblog/templates/rss.xml2
2 files changed, 4 insertions, 10 deletions
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 @@
<title>The SimpleBlog</title>
<link>http://example.com</link>
<description>Simple blog in hakyll</description>
- $items
+ $body
</channel>
</rss>