mmistakes / jekyll-theme-skinny-bones

A Jekyll starter with a variety of flexible layouts and components.
https://mmistakes.github.io/jekyll-theme-skinny-bones
MIT License
804 stars 906 forks source link

Using pagination #29

Closed hacdias closed 9 years ago

hacdias commented 9 years ago

Hi!

I'm new to jekyll and I'm trying to use this template. Well, I'm using it but I want to use pagination, but I don't know how to use it.

I have put this:

paginate: 12
paginate_path: "/page:num/"

On _config.yml file but I always receive the warning Pagination: Pagination is enabled, but I couldn't find an index.html page to use as the pagination template. Skipping pagination.

I saw that there is a file called "pagination.html". How should I use it with the archive template?

Thanks :)

mmistakes commented 9 years ago

I haven't gotten around to building anything related to paginating posts yet. The pagination.html file you found is just an include with some bits to do post nav (next and previous post).

The reason you got that error is you need to add the paginator object to a page. To do that you'll want to modify the index.html in the root of the project (what is essentially your sites homepage). If you want to see an example of how to do it check out my other theme HPSTR.

You'll want to change any {% for post in site.posts %}' to{% for post in paginator.posts %}` and then add the other paginator attributes for things like next/previous page links, current page, page count, etc.

It's not that too hard but it does have some quirks which is why I omitted it (doesn't support paginating posts over categories or tags). The Jekyll docs are pretty good to get you started.

hacdias commented 9 years ago

@mmistakes thanks for the fast answer. I'm going to try! =D