# 3 questions about category pages on Jekyll

**URL:** <https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612>\
**Category:** Help\
**Created:** [November 19, 2019, 1:17pm UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612 "2019-11-19T13:17:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![miracleofweb](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@miracleofweb](https://talk.jekyllrb.com/u/miracleofweb)\
**Post date:** [November 19, 2019, 1:17pm UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/1 "2019-11-19T13:17:24Z")

</div>

Hello!

Please, help me to understand. I have 3 questions about category pages on Jekyll.

1. If I want to create a category page, I should just create a page, where write loop `{% for %}` to get post lists? And then how to get URL of specific category?

2. And If I have 5 categories with different design layouts, then I should create 5 different pages for categories?

3. Should I put category files in a special folder, like \_category or something else? For example, all website posts I should put into the \_posts folder.

Sorry for bad English, friends. Love you all and thank you for help!

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [November 20, 2019, 11:50pm UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/2 "2019-11-20T23:50:29Z")

</div>

jekyll on its own does not have an easy way to make the category pages, so yes, you can create a page for each category, or one page for all categories and loop thru them to get what you want. There is no right or wrong way to do it.

Posts have to be in a \_posts folder, you can put a \_posts subfolder into a parent folder called `cats` and jekyll will consider the parent folder of `cats` to be a category for any posts in that folder.

You can have more than one \_posts folder, so you could have folders named cats, dogs and birds and each of those could have a sub folder called \_posts, and post in that sub folder would have the parent folder as a category.

That said I don’t see any actual documentation for that and I find it a little confusing, I would think there would be one \_posts folder with sub folders in it and those would be the categories but I don’ think it works that way.

You can of course just set the category in the posts front matter.

There is a plugin called Jekyll Archives - [https://github.com/jekyll/jekyll-archives/blob/master/docs/configuration.md](https://github.com/jekyll/jekyll-archives/blob/master/docs/configuration.md) that is fairly popular, it will auto generate category pages for you. I am not sure that will work with GH pages though.

---

<div class="post-metadata">

**Author:** ![miracleofweb](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@miracleofweb](https://talk.jekyllrb.com/u/miracleofweb)\
**Post date:** [November 21, 2019, 7:36am UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/3 "2019-11-21T07:36:00Z")

</div>

Thank you very much, rdyar! You always help me out!

I no have problems with creating pages for categories, then I can create `loop` to get post lists.

But one of my questions remained unanswered. If I set category on Front Matter with writing `cats` into the post.

Then I create page `cats.md` for category. How I should setting permalinks for this category? If on post’s Front Matter written `cats`, permalink on `cats.md` page should be /cats?

And is all this done manually? In post’s Front Matter I write the category, and on the category page (`cats.md`) I write permalink. So easy to make a mistake)

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [November 21, 2019, 5:57pm UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/4 "2019-11-21T17:57:56Z")

</div>

you don’t need to do the permalink on any of the pages, it is optional. You normally set the permalink in the config file where it would affect all pages/posts. This is configurable, but generally the post permalink would include the category and the post title - and sometimes the date if you like that. The cats category page would be a page and not a post, and generally that is title only.

> **[Permalinks](https://jekyllrb.com/docs/permalinks/)**
>
> Permalinks are the output path for your pages, posts, or collections. They allow you to structure the directories of your source code different from the directories in your output.

---

<div class="post-metadata">

**Author:** ![miracleofweb](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@miracleofweb](https://talk.jekyllrb.com/u/miracleofweb)\
**Post date:** [November 22, 2019, 6:32am UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/5 "2019-11-22T06:32:49Z")

</div>

Man, you bit don’t understand me, sorry. Our English is so bad))

**My question about permalink settings for categories:**

If I write category `cat` on the post’s Front Matter.

Then for `cat` page (categories page) I write permalink: `cat-category` . How will it work? Permalink of the `cat` 's category will be `cat` , or `cat-category` ?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [November 22, 2019, 7:38am UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/6 "2019-11-22T07:38:43Z")

</div>

haha, yeah, I am a little lost.

Using the word Cat in an example for a category was a terrible idea, I apologize. Now when you say cat I don’t actually know what you are referring to - cat - meow, or cat as a category.

Lets say you have an article about dogs, so it has a category of dogs. You then have a page called dogs.md where you list all of the articles about the dogs category.

The permalink of the page where you list all of the items from the category will not change anything else - so if you have a permalink of `/dog/` or `/dog-category/` that will only be on that page, it will not effect an article about dogs that has that as a category.

Best bet is to try things out - then ask a question of why something does not work (if that is the case). Asking hypothetical questions makes it hard to give an answer.

---

<div class="post-metadata">

**Author:** ![miracleofweb](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@miracleofweb](https://talk.jekyllrb.com/u/miracleofweb)\
**Post date:** [November 22, 2019, 7:42am UTC](https://talk.jekyllrb.com/t/3-questions-about-category-pages-on-jekyll/3612/7 "2019-11-22T07:42:15Z")

</div>

Thank you very much, rdyar! Now you understand me, and I understand you too.

Yes, I meant it! I write article about Rabbit breeding. And I set category `rabbit` for this article.

Then I create page `rabbit.md`, where I display all my articles about rabbits. And I can change category url for `rabbit.md` page (example: `hot-rabbits`), and this will not affect the work in any way.

Thank you for answer!
