statamic / ssg

The official Statamic Static Site Generator
232 stars 24 forks source link

Pagination support #140

Closed jesseleite closed 1 year ago

jesseleite commented 1 year ago

Previously, we linked people to this gist, which was self-described as a temporary workaround:

We will likely introduce better native support for pagination at some point, but for now, this is an okay workaround that only requires a little code.

This PR adds intelligent pagination support by detecting where paginators are used in core (ie. the {{ collection }} tag with the paginate parameter), generating /articles/page/2 style urls for each page where necessary.

No extra setup or user config is required, unless the user wishes to customize the output url, which they can do like so...

This PR also respects multisite collection indexes, as well as collection tag per-page settings, filters, query scopes, pagination links, auto_links, etc.

Closes #10 Closes #63

mbootsman commented 1 year ago

Great! It works perfectly. Thanks a lot!!