Why no categories or id for pages? #1168

anarchodin opened this Issue Jun 1, 2013 · 7 comments


None yet

6 participants


I don't quite understand why a few of the variables that are autogenerated for posts are not available for pages as well. In particular, it seems odd not to provide pages with id and categories; both could easily be determined from the filesystem and their availability would make consistent treatment of static and dynamic parts of a Jekyll-generated site easier.

So I'm wondering if there's a conscious design choice behind this difference in treatment, or if it's a historical accident. I would've directed this at the mailing list, except that seems to have had no activity for several months now...

parkr commented Jun 1, 2013


@qrush, @tmm1, and @mojombo might be better suited to discuss the historical events which led to the divergence of these two types of content, but I would hazard a guess that it was a conscious design decision based on existing blogging platforms of the time.

Posts – writings about topics numerous – were given this ability to categorise and tag in order to offer logical groupings of a long list of posts. Pages are meant to be singular and unique. My site may include logical sections of pages (e.g. /docs/), but what is the need or advantage of assigning each page the category docs, as determined by the filesystem?

With regard to your question about why pages don't have ID's, I don't know to what it is you are referring, so you'll have to be a bit more clear on that before I can offer any explanation.


Specifically, I mean the page.categories and page.id variables that are available to posts but not pages. Both are useful in generating navigation (particularly with the active page or category marked) from filesystem structure rather than explicitly placing navigation metadata into the individual files.




I want to add to this that when adding categories: foo bar to the front matter of a page the categories do actually appear when using the {{ page.categories }} liquid tag, but since there isn't any processing of the categories inside page.rb it's simply a string instead of the array that categories should be.

This caused me some trouble with filtering {{ page.categories }} because one expects the input to be an array.

I guess the nicest fix would be making categories work for pages as they do for posts as discussed in this issue.

parkr commented Nov 15, 2013

@mattr- I have changed my mind about categorization for pages – I certainly see the value in globbing together certain pages based on a category. A great example is our jekyllrb.com site -- group the docs together and allow us to iterate over them, etc.

Thoughts on #670 as a catch-all?


+1. This would be very useful.

#670 would be a good solution, if it also applies to pages in addition to posts.

This was referenced Mar 12, 2014
parkr commented Jul 31, 2014

Categories are for posts – try Collections. That should help solve your problem. They're available on GHP now.

@parkr parkr closed this Jul 31, 2014
@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.