@@ -28,6 +28,7 @@ import System.Locale (defaultTimeLocale)
2828import Hakyll.Core.Compiler
2929import Hakyll.Core.Identifier
3030import Hakyll.Core.Item
31+import Hakyll.Core.Metadata
3132import Hakyll.Web.Template
3233import Hakyll.Web.Template.Context
3334
@@ -59,7 +60,7 @@ applyJoinTemplateList delimiter tpl context items = do
5960-- | Sort pages chronologically. This function assumes that the pages have a
6061-- @year-month-day-title.extension@ naming scheme -- as is the convention in
6162-- Hakyll.
62−chronological :: [Item a] -> Compiler [Item a]
63+chronological :: MonadMetadata m => [Item a] -> m [Item a]
6364chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
6465 where sortByM :: (Monad m, Ord k) => (a -> m k) -> [a] -> m [a]
6566 sortByM f xs = liftM (map fst . sortBy (comparing snd)) $
@@ -67,5 +68,5 @@ chronological = sortByM $ getItemUTC defaultTimeLocale . itemIdentifier
6768
6869--------------------------------------------------------------------------------
6970-- | The reverse of 'chronological'
70−recentFirst :: [Item a] -> Compiler [Item a]
71−recentFirst i = return . reverse =<< chronological i
71+recentFirst :: (MonadMetadata m, Functor m) => [Item a] -> m [Item a]
72+recentFirst = fmap reverse . chronological