diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-08-06 11:21:45 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-08-06 11:21:45 +0200 |
commit | a09a27027a1e0ae56bc9c0ec8053cae20b8ebf69 (patch) | |
tree | 8612e0e500b23ee6c876ba276565d2005ea51cef | |
parent | acbdf6c329fa1f71dac1a035557150033586f784 (diff) | |
download | hakyll-a09a27027a1e0ae56bc9c0ec8053cae20b8ebf69.tar.gz |
Fix link bug in paginate module
-rw-r--r-- | src/Text/Hakyll/Paginate.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Hakyll/Paginate.hs b/src/Text/Hakyll/Paginate.hs index 1b6c015..04194ca 100644 --- a/src/Text/Hakyll/Paginate.hs +++ b/src/Text/Hakyll/Paginate.hs @@ -1,4 +1,5 @@ -- | Module aimed to paginate web pages. +-- module Text.Hakyll.Paginate ( PaginateConfiguration (..) , defaultPaginateConfiguration @@ -13,6 +14,7 @@ import Text.Hakyll.HakyllAction import Text.Hakyll.Util (link) -- | A configuration for a pagination. +-- data PaginateConfiguration = PaginateConfiguration { -- | Label for the link to the previous page. previousLabel :: String @@ -25,6 +27,7 @@ data PaginateConfiguration = PaginateConfiguration } -- | A simple default configuration for pagination. +-- defaultPaginateConfiguration :: PaginateConfiguration defaultPaginateConfiguration = PaginateConfiguration { previousLabel = "Previous" @@ -54,6 +57,7 @@ defaultPaginateConfiguration = PaginateConfiguration -- When @$previous@ or @$next@ are not available, they will be just a label -- without a link. The same goes for when we are on the first or last page for -- @$first@ and @$last@. +-- paginate :: PaginateConfiguration -> [HakyllAction () Context] -> [HakyllAction () Context] @@ -61,7 +65,8 @@ paginate configuration renderables = paginate' Nothing renderables (1 :: Int) where -- Create a link with a given label, taken from the configuration. linkWithLabel f r = Right $ case actionUrl r of - Left l -> createSimpleHakyllAction $ link (f configuration) <$> l + Left l -> createSimpleHakyllAction $ + link (f configuration) . ("$root/" ++) <$> l Right _ -> error "No link found for pagination." -- The main function that creates combined renderables by recursing over |