hakyll-2.0: A simple static site generator library.Source codeContentsIndex
Text.Hakyll.Paginate
Description
Module aimed to paginate web pages.
Synopsis
data PaginateConfiguration = PaginateConfiguration {
previousLabel :: String
nextLabel :: String
firstLabel :: String
lastLabel :: String
}
defaultPaginateConfiguration :: PaginateConfiguration
paginate :: PaginateConfiguration -> [HakyllAction () Context] -> [HakyllAction () Context]
Documentation
data PaginateConfiguration Source
A configuration for a pagination.
Constructors
PaginateConfiguration
previousLabel :: StringLabel for the link to the previous page.
nextLabel :: StringLabel for the link to the next page.
firstLabel :: StringLabel for the link to the first page.
lastLabel :: StringLabel for the link to the last page.
defaultPaginateConfiguration :: PaginateConfigurationSource
A simple default configuration for pagination.
paginate :: PaginateConfiguration -> [HakyllAction () Context] -> [HakyllAction () Context]Source

The most important function for pagination. This function operates on a list of Contexts (the pages), and basically just adds fields to them by combining them with a custom page.

The following metadata fields will be added:

  • $previous: A link to the previous page.
  • $next: A link to the next page.
  • $first: A link to the first page.
  • $last: A link to the last page.
  • $index: 1-based index of the current page.
  • $length: Total number of pages.

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.

Produced by Haddock version 2.7.2