Collections and categories - question about Autopages

Hi all, looking for some advice please.

I’ve done a lot of searching and want to ascertain the best way of achieving the below. My project is on the dev-jekyll branch here:

I have a project here which features blog posts and a single collection, Events. I plan to have categories enabled on both, and be able to link to a page that lists items within each category (and filtered by type).

For example, events/mobile/ and blog/mobile/ would list different content.

I’m new to jekyll (and enjoying it so far) but more experienced in WordPress. This would be very easy in WP, but seems challenging to do this in Jekyll automatically. (I am building the site for a client, so this needs to be very easy to manage, and manually creating category pages has more scope for error.)

Using jekyll-archive I have this working for blog but understand this doesn’t work for collections.

As I also need to add pagination, I was looking at the Autopages feature of jekyll-paginate-v2, but I’m finding the documentation confusing.

Does this plugin create archive pages per category or simply paginate them?

From what I read, the plugin should solve my problem but it looks like it’s unsupported on Jekyll 4 (which I’m currently running).

Any advice would be really appreciated.

Thanks!

category is a specific thing for posts but not for collections. You could have a front matter variable on a collection called category, but it would not get included with the posts, and would probably be bad form - since it is a reserved thing for posts.

I have not used that plug in so I can’t help on that. It is unclear at this point what your actual issue is, sort of sounds like you are set for posts but not for the collection? it may be difficult to set it up for collections, there is no concept of pagination for collection that I am aware of (could be wrong).

If there was only to be a few categories you could build your own page to list them, but again there would not be pagination.

Thanks - I’ve seen a few posts online about ways of tackling this but they all either:

  • create faux-category using front matter and then manually creating index pages for each (kinda what you’re suggesting)

  • using just posts but having two master categories and then sub categories

What I’m trying to achieve is fairly standard stuff, but perhaps not out of the box with jekyll. Essentially, you could substitute ‘Events’ in my example for ‘Portfolio’ - people often want to sort and filter their portfolio pieces and have a blog on the same site. There is a taxonomy for both content types.

you can also have them all be posts and make your own front matter called type (or whatever you want to call it) - and then have type: video or type:article or for you type: event and then use categories or tags and then divide stuff up that way.