@@ -156,7 +156,8 @@ We can reproduce a list of items in the archive using the following code:
156compile $ do
156compile $ do
157 posts <- recentFirst <$> loadAll "posts/*"
157 posts <- recentFirst <$> loadAll "posts/*"
158 itemTpl <- loadBody "templates/post-item.html"
158 itemTpl <- loadBody "templates/post-item.html"
159− applyTemplateList itemTpl postCtx posts
159+ list <- applyTemplateList itemTpl postCtx posts
162`recentFirst` sorts items by date. This relies on the convention that posts are
163`recentFirst` sorts items by date. This relies on the convention that posts are
@@ -169,4 +170,5 @@ recentFirst :: [Item a] -> [Item a]
170After loading and sorting the items, we load a template for the posts.
171After loading and sorting the items, we load a template for the posts.
171`applyTemplateList` applies this template to every post and concatenates the
172`applyTemplateList` applies this template to every post and concatenates the
172−result, which is a simple `String`.
173+result, which is a simple `String`. After that, we need `makeItem` to wrap the
174+returned `String` to `Item String`.