From: sabadev Date: Sun, 28 Mar 2021 00:08:57 +0000 (-0400) Subject: Sorted the blog links. X-Git-Url: http://sabadev.xyz:4321/?a=commitdiff_plain;h=50a9a2ee7ace724df12be44dd803e2d5830c4ab9;p=website.git Sorted the blog links. --- 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