From f554afbec040f822ddf5dd62d71d33541c74a2ed Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 8 Jan 2013 20:14:54 +0100 Subject: Fix tutorial: needed makeItem --- web/tutorials/04-compilers.markdown | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/tutorials/04-compilers.markdown b/web/tutorials/04-compilers.markdown index cb963a6..ef2877b 100644 --- a/web/tutorials/04-compilers.markdown +++ b/web/tutorials/04-compilers.markdown @@ -156,7 +156,8 @@ We can reproduce a list of items in the archive using the following code: compile $ do posts <- recentFirst <$> loadAll "posts/*" itemTpl <- loadBody "templates/post-item.html" - applyTemplateList itemTpl postCtx posts + list <- applyTemplateList itemTpl postCtx posts + makeItem list ``` `recentFirst` sorts items by date. This relies on the convention that posts are @@ -169,4 +170,5 @@ recentFirst :: [Item a] -> [Item a] After loading and sorting the items, we load a template for the posts. `applyTemplateList` applies this template to every post and concatenates the -result, which is a simple `String`. +result, which is a simple `String`. After that, we need `makeItem` to wrap the +returned `String` to `Item String`. -- cgit v1.2.3