diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-24 10:50:38 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-24 10:55:11 +0100 |
commit | b91c8be54b14a84aa47b5033a9966653df7f84ca (patch) | |
tree | 795341847c1554b578604dca3be361dd47529318 /web/tutorials/04-compilers.markdown | |
parent | 9b603587de20d42d95e6affc2bce85447de6f58e (diff) | |
download | hakyll-b91c8be54b14a84aa47b5033a9966653df7f84ca.tar.gz |
Update example & tutorials with new recentFirst
Diffstat (limited to 'web/tutorials/04-compilers.markdown')
-rw-r--r-- | web/tutorials/04-compilers.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/tutorials/04-compilers.markdown b/web/tutorials/04-compilers.markdown index 522f817..cdc8eb0 100644 --- a/web/tutorials/04-compilers.markdown +++ b/web/tutorials/04-compilers.markdown @@ -158,18 +158,18 @@ We can reproduce a list of items in the archive using the following code: ```haskell compile $ do - posts <- recentFirst <$> loadAll "posts/*" + posts <- recentFirst =<< loadAll "posts/*" itemTpl <- loadBody "templates/post-item.html" list <- applyTemplateList itemTpl postCtx posts makeItem list ``` `recentFirst` sorts items by date. This relies on the convention that posts are -always named `YYYY-MM-DD-title.extension` in Hakyll -- if you use some other -format, you'll have to write some other sorting method. +always named `YYYY-MM-DD-title.extension` in Hakyll -- or that the date must be +present in the metadata. ```haskell -recentFirst :: [Item a] -> [Item a] +recentFirst :: [Item a] -> Compiler [Item a] ``` After loading and sorting the items, we load a template for the posts. |