-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for pagination #96
Comments
Since it's a static site, Hugo should generate different html files to support next page, prev page. maybe index_page_1.html, index_page_2.html etc. |
This is really nice idea. For clean urls, it could be...
|
Yeah I would really like this feature too. |
I saw this on Hugo Discuss, and thought I would place it here. Looks like a good strategy for pagination: Thoughts? |
@spf13 [Steve], is anyone working on this issue? |
Yes. Well I'm planning on it for the next release. |
Any updates on this? |
+1 must have feature |
+1 waiting for this feature |
+1 this is a must have feature :) |
+1 Also. This is the missing element from my point of view and also the reason why I haven't abandoned Octopress yet. |
It's on my top wanted list as well (and I would love to contribute som development hours to it), but to scope it down, I guess it should work for (by some setting)
Any tips, hints, requirements? |
Same here, I tried to go deep into Hugo but didn't really find where to focus. Next try maybe :) |
+1 |
I opened up a discussion about an implementation mine of this: http://discuss.gohugo.io/t/pagination-implementation-feedback-appreciated/519 The implementation is still a little unpolished, but works and it shouldn't be too long until PR time. |
A new configuration property `paginate` is added with default value `0`. This setting will generate the site with no pagination, as it is today. Setting `paginate` to a positive value will split the list pages for sections and taxonomies into chunks of size of the `paginate` property. `Data.Paginator` is provided as a template variable to help building a pager menu. `Data.Paginator.Pages` contains the pages for "that page" and `Data.Pages` will (like today) contain all the pages. The pages are built on the form: ``` [SECTION/TAXONOMY]/index.html [SECTION/TAXONOMY]/page/1/index.html => redirect to [SECTION/TAXONOMY]/index.html [SECTION/TAXONOMY]/page/2/index.html .... ``` Fixes #96
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
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
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 gohugoio#96
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
No description provided.
The text was updated successfully, but these errors were encountered: