summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/tutorials/04-compilers.markdown6
1 files changed, 4 insertions, 2 deletions
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`.