Jekyll Category Templates

There will be two types of posts on my site: blog and portfolio . I want to have a page for each of these categories, displaying only posts from this category.

What is the best way to achieve this in Jekyll? I did my homework, but I try my best to find a good answer.

+6
source share
1 answer

If you put the message in the posts and portfolio folder, jekyll will naturally define 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 creates a category page, you can take inspiration from this post: http://www.justkez.com/generating-a-tag-cloud-in-jekyll/ , except that instead of creating tag page, you create a category page.

EDIT

There are also generate_category.rb plugins that can help you: http://recursive-design.com/projects/jekyll-plugins/

+6
source

Source: https://habr.com/ru/post/920548/


All Articles