mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
37445bc6aa
Two new configuration properties, `Paginate` (default `0`) and `PaginatePath` (default `page`) are added. Setting `paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of size of the `paginate` property. A `.Paginator` is provided to help building a pager menu. There are two ways to configure a `.Paginator`: 1. The simplest way is just to call `.Paginator.Pages` from a template. It will contain the pages for "that page" (`.Data.Pages` will (like today) contain all the pages). 2. Select a sub-set of the pages with the available template functions and pass the slice to `.Paginate` : `{{ range (.Paginate (where .Data.Pages "Type" "post")).Pages }}` **NOTE:** For a given Node, it's one of the options above. It's perfectly legitimate to iterate over the same pager more than once, but it's static and cannot change. The `.Paginator` contains enough information to build a full-blown paginator interface. The pages are built on the form (note: BLANK means no value, i.e. home page): ``` [SECTION/TAXONOMY/BLANK]/index.html [SECTION/TAXONOMY/BLANK]/page/1/index.html => redirect to [SECTION/TAXONOMY/BLANK]/index.html [SECTION/TAXONOMY/BLANK]/page/2/index.html .... ``` Fixes #96 |
||
---|---|---|
.. | ||
author.go | ||
benchmark_test.go | ||
handler_base.go | ||
handler_file.go | ||
handler_meta.go | ||
handler_page.go | ||
hugo.go | ||
media.go | ||
menu.go | ||
menu_test.go | ||
node.go | ||
page.go | ||
page_permalink_test.go | ||
page_taxonomy_test.go | ||
page_test.go | ||
page_time_integration_test.go | ||
pageGroup.go | ||
pageGroup_test.go | ||
pageSort.go | ||
pagesPrevNext.go | ||
pagesPrevNext_test.go | ||
pagination.go | ||
pagination_test.go | ||
path_separators_test.go | ||
path_separators_windows_test.go | ||
permalinks.go | ||
permalinks_test.go | ||
planner.go | ||
redis.cn.md | ||
rss_test.go | ||
shortcode.go | ||
shortcode_test.go | ||
shortcodeparser.go | ||
shortcodeparser_test.go | ||
site.go | ||
site_show_plan_test.go | ||
site_test.go | ||
site_url_test.go | ||
siteinfo_test.go | ||
sitemap.go | ||
sitemap_test.go | ||
summary.go | ||
taxonomy.go | ||
taxonomy_test.go |