Reputation:
On my site, there will be two types of posts: blog
and portfolio
. I want to have a page for each of these categories, displaying only posts from that category.
What is the best way to achieve this in Jekyll? I've done some homework but I'm struggling to find a good answer.
Upvotes: 6
Views: 2140
Reputation: 3384
If you put the post into folder posts
and portfolio
, jekyll will naturally defined two categories
root
|-- posts
| `-- _posts
| |-- 2012-01-12-post.textile
| `-- 2012-03-22-post.textile
`-- portfolio
`-- _posts
|-- 2011-04-05-post.textile
`-- 2012-02-02-post.textile
Then you can have a generator that will create the category page, you may then take inspiration from this post: http://www.justkez.com/generating-a-tag-cloud-in-jekyll/ except that instead of generating the tag page, you generate the category page.
EDIT
There is also this plugins generate_category.rb
that can help you: http://recursive-design.com/projects/jekyll-plugins/
Upvotes: 6