octopress / paginate

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

can't filter collections by tags or categories #8

Closed bhinebaugh closed 9 years ago

bhinebaugh commented 9 years ago

Specifying both a collection and tag / category to use for filtering it in the front matter:

paginate:
  collection: my_collection
  tag: parts

results in an undefined method error for Jekyll::Document

So looks like tags assigned to collection items aren't accessible in the same way as tags assigned to posts? (happening in the reject loop of def collection(page))

imathis commented 9 years ago

I'm sorry, but I won't be able to fix this for you. This relies on Jekyll's tag/category system which apparently only applies to posts. If Jekyll adds support for tagging or categorizing collections, this should work properly.

tepreece commented 9 years ago

It can't be done properly, for the reasons lmathis already indicated, however as I needed to filter collections on tags I implemented a (slightly hacky) way of faking it. Please see this pull request for details: https://github.com/octopress/paginate/pull/13