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

Closed
spf13 opened this Issue Oct 8, 2013 · 15 comments

Comments

Projects
None yet
@spf13
Contributor

spf13 commented Oct 8, 2013

No description provided.

@nickelchen

This comment has been minimized.

Show comment
Hide comment
@nickelchen

nickelchen Feb 13, 2014

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.

nickelchen commented Feb 13, 2014

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.

@rahul286

This comment has been minimized.

Show comment
Hide comment
@rahul286

rahul286 Aug 14, 2014

Contributor

This is really nice idea.

For clean urls, it could be...

/public/section/index.html
/public/section/page/1/index.html --> redirect to /public/section/index.html
/public/section/page/2/index.html
/public/section/page/3/index.html
Contributor

rahul286 commented Aug 14, 2014

This is really nice idea.

For clean urls, it could be...

/public/section/index.html
/public/section/page/1/index.html --> redirect to /public/section/index.html
/public/section/page/2/index.html
/public/section/page/3/index.html
@Koenyn

This comment has been minimized.

Show comment
Hide comment
@Koenyn

Koenyn Sep 2, 2014

Yeah I would really like this feature too.

Koenyn commented Sep 2, 2014

Yeah I would really like this feature too.

@wallflower

This comment has been minimized.

Show comment
Hide comment
@wallflower

wallflower Sep 3, 2014

I saw this on Hugo Discuss, and thought I would place it here. Looks like a good strategy for pagination:
http://googlewebmastercentral.blogspot.ca/2014/02/infinite-scroll-search-friendly.html?m=1

Thoughts?

wallflower commented Sep 3, 2014

I saw this on Hugo Discuss, and thought I would place it here. Looks like a good strategy for pagination:
http://googlewebmastercentral.blogspot.ca/2014/02/infinite-scroll-search-friendly.html?m=1

Thoughts?

@chaseadamsio

This comment has been minimized.

Show comment
Hide comment
@chaseadamsio

chaseadamsio Sep 14, 2014

Contributor

@spf13 [Steve], is anyone working on this issue?

Contributor

chaseadamsio commented Sep 14, 2014

@spf13 [Steve], is anyone working on this issue?

@spf13

This comment has been minimized.

Show comment
Hide comment
@spf13

spf13 Sep 14, 2014

Contributor

Yes. Well I'm planning on it for the next release.

Contributor

spf13 commented Sep 14, 2014

Yes. Well I'm planning on it for the next release.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 16, 2014

Any updates on this?

ghost commented Nov 16, 2014

Any updates on this?

@kshcherban

This comment has been minimized.

Show comment
Hide comment
@kshcherban

kshcherban Nov 18, 2014

+1 must have feature

kshcherban commented Nov 18, 2014

+1 must have feature

@azmelanar

This comment has been minimized.

Show comment
Hide comment
@azmelanar

azmelanar Nov 18, 2014

+1 waiting for this feature

azmelanar commented Nov 18, 2014

+1 waiting for this feature

@Fale

This comment has been minimized.

Show comment
Hide comment
@Fale

Fale Dec 14, 2014

Contributor

+1 this is a must have feature :)

Contributor

Fale commented Dec 14, 2014

+1 this is a must have feature :)

@JulienD

This comment has been minimized.

Show comment
Hide comment
@JulienD

JulienD Dec 16, 2014

+1 Also. This is the missing element from my point of view and also the reason why I haven't abandoned Octopress yet.

JulienD commented Dec 16, 2014

+1 Also. This is the missing element from my point of view and also the reason why I haven't abandoned Octopress yet.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Dec 16, 2014

Member

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)

  • section list pages
  • taxonomy list pages

Any tips, hints, requirements?

Member

bep commented Dec 16, 2014

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)

  • section list pages
  • taxonomy list pages

Any tips, hints, requirements?

@JulienD

This comment has been minimized.

Show comment
Hide comment
@JulienD

JulienD Dec 17, 2014

Same here, I tried to go deep into Hugo but didn't really find where to focus. Next try maybe :)

JulienD commented Dec 17, 2014

Same here, I tried to go deep into Hugo but didn't really find where to focus. Next try maybe :)

@thomasmodeneis

This comment has been minimized.

Show comment
Hide comment

thomasmodeneis commented Dec 26, 2014

+1

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Dec 28, 2014

Member

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.

Member

bep commented Dec 28, 2014

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.

bep added a commit to bep/hugo that referenced this issue Jan 16, 2015

Add pagination support for sections and taxonomies
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

bep added a commit to bep/hugo that referenced this issue Jan 26, 2015

Add pagination support for home page, sections and taxonomies
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

@bep bep closed this Jan 26, 2015

bep added a commit that referenced this issue Jan 26, 2015

Add pagination support for home page, sections and taxonomies
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

nithinphilips added a commit to nithinphilips/lanyon-hugo that referenced this issue Sep 21, 2015

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Add pagination support for home page, sections and taxonomies
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment