From 50a9a2ee7ace724df12be44dd803e2d5830c4ab9 Mon Sep 17 00:00:00 2001 From: sabadev Date: Sat, 27 Mar 2021 20:08:57 -0400 Subject: [PATCH] Sorted the blog links. --- src/Html.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Html.hs b/src/Html.hs index ee8444c..a6a2ca8 100644 --- a/src/Html.hs +++ b/src/Html.hs @@ -3,6 +3,7 @@ module Html where import ApiTypes import Control.Monad (void) import Control.Monad.IO.Class (MonadIO(..), liftIO) +import Data.List (sort) import Data.Maybe (fromMaybe) import Lucid import Sanitize @@ -32,7 +33,7 @@ navigation theme = do blogListItems blogList :: (MonadIO m) => Maybe Theme -> m (Html ()) -blogList theme = liftIO $ getDirectoryContents staticPath >>= pure . foldMap (blogListItem theme) . filter (T.isSuffixOf markdownExtension) . fmap T.pack +blogList theme = liftIO $ getDirectoryContents staticPath >>= pure . foldMap (blogListItem theme) . sort . filter (T.isSuffixOf markdownExtension) . fmap T.pack blogListItem :: Maybe Theme -> T.Text -> Html () blogListItem theme (blogLink -> Nothing) = pure $ mempty -- 2.20.1