Skip to content
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

Collection is always empty #41

Closed
aprilmintacpineda opened this issue Aug 13, 2017 · 1 comment
Closed

Collection is always empty #41

aprilmintacpineda opened this issue Aug 13, 2017 · 1 comment

Comments

@aprilmintacpineda
Copy link

aprilmintacpineda commented Aug 13, 2017

Documentation is extremely poor and is hard to understand for beginners like me.
First I tried to paginate by category but a deprecation warning occurred -> #35

Now I tried to paginate by collection but the paginator.collection_name is always empty even if there is a post in it.

Folder structure

root
- collection/
--- _howtos/
------ how-to-remove-virus.md
--- howtos.html

howtos.html

---
layout: default
page_title: how-tos
paginate: true
paginate:
  collection: howtos
  per_page: 1
  limit: false
  permalink: /:num/
---

{{ paginator }}

Output:

{"howtos"=>[], "page"=>1, "per_page"=>1, "limit"=>false, "total_howtos"=>0, "total_pages"=>0, "previous_page"=>nil, "previous_page_path"=>nil, "next_page"=>nil, "next_page_path"=>nil}
@aprilmintacpineda
Copy link
Author

I get it, my folder structure was wrong:

root
- _howtos # all posts goes inside this folder

And now it works.

{"howtos"=>[#], "page"=>1, "per_page"=>1, "limit"=>false, "total_howtos"=>1, "total_pages"=>1, "previous_page"=>nil, "previous_page_path"=>nil, "next_page"=>nil, "next_page_path"=>nil}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant