Loading src/Build.hs +3 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ buildArticles navbar inputs = do where extraMeta = Meta $ Map.fromList [("navbar", navbar)] -- | Gets the previous and next neigbors for each article in the list. This only works if every pandocument has the link meta value set. getNeighbors :: [Pandoc] -> [(Maybe MetaValue, Maybe MetaValue)] getNeighbors articles = f <$> [0..(length articles - 1)] where -- Index + 1 is previous as the newest is first in the list Loading @@ -84,7 +85,8 @@ getNeighbors articles = f <$> [0..(length articles - 1)] where getLink :: Pandoc -> Maybe MetaValue getLink (Pandoc meta _) = lookupMeta "link" meta -- TODO replace with library function -- | Safely retrieve an item from a list, returning Nothing on failure. safeIndex :: [a] -> Int -> Maybe a safeIndex [] _ = Nothing safeIndex _ n | n < 0 = Nothing Loading Loading
src/Build.hs +3 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ buildArticles navbar inputs = do where extraMeta = Meta $ Map.fromList [("navbar", navbar)] -- | Gets the previous and next neigbors for each article in the list. This only works if every pandocument has the link meta value set. getNeighbors :: [Pandoc] -> [(Maybe MetaValue, Maybe MetaValue)] getNeighbors articles = f <$> [0..(length articles - 1)] where -- Index + 1 is previous as the newest is first in the list Loading @@ -84,7 +85,8 @@ getNeighbors articles = f <$> [0..(length articles - 1)] where getLink :: Pandoc -> Maybe MetaValue getLink (Pandoc meta _) = lookupMeta "link" meta -- TODO replace with library function -- | Safely retrieve an item from a list, returning Nothing on failure. safeIndex :: [a] -> Int -> Maybe a safeIndex [] _ = Nothing safeIndex _ n | n < 0 = Nothing Loading