Sorted the blog links.
authorsabadev <saba@sabadev.xyz>
Sun, 28 Mar 2021 00:08:57 +0000 (20:08 -0400)
committersabadev <dev@sabadev.xyz>
Tue, 13 Apr 2021 01:16:45 +0000 (21:16 -0400)
src/Html.hs

index ee8444c..a6a2ca8 100644 (file)
@@ -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