octopress / paginate

A simple paginator for Jekyll sites.
MIT License
105 stars 37 forks source link

Y u no work? #14

Closed entozoon closed 8 years ago

entozoon commented 9 years ago

Hey, this plugin looks brilliant, although I can't quite get it to work. Perhaps my folder structure? This is a stripped down version of what I've got going on:

Here is my listing page, which outputs nothing at all. /penguins/index.md


---
paginate: true

---
{{ paginator.total_posts }}
{% for penguin in paginator.penguins %}
{{ penguin}}
{{ penguin.title }}
{% endfor %}

/_config.yml

pagination:
  limit: false
  per_page: 2

An actual post: /penguins/_posts/2014-01-01-post.md


---
title: Post
paginate:
  collection: penguins

---
Test

/gemfile

gem 'octopress-paginate'
shawnthroop commented 8 years ago

Try putting 2014-01-01-post.md in a folder called _penquins. Or, change paginator.penquins to paginator.posts. From my understanding the keyword following paginator must match the folder name that the files are in.

entozoon commented 8 years ago

Ah, I actually made a mistake in my post. I'll update my question, the post is in the folder: /penguins/_posts which looks correct to me as far as I can tell but as I say, nothing's happening.

entozoon commented 8 years ago

Is this the end of the story? Pagination like this is just not an achievable thing.

imathis commented 8 years ago

Your collection isn't named properly according to Jekyll configurations. If you have a collection named "penguins" your posts should be in:

_penguins/
  2014-01-01-post.md

You'll also need to register your collection with Jekyll by adding this to your _config.yml if you haven't already:

collections:
  - penguins

If you have that done, pagination should work. The key here is that you must be sure Jekyll is aware of your collection. If it isn't the pagination plugin won't find them either. If you have issues with collections be sure to reference Jekyll's documentation, and try examples from there to be sure it's working correctly.

XhmikosR commented 8 years ago

@parkr: this can be closed as invalid based on the previous comment.