I have a jekyll website and I have a category (called photo
) and I wanted to create a separate layout for a page that would list just the posts that were in the photo
category. I also want to keep posts with the photo
category out of the main index page.
22
votes
3 Answers
34
votes
24
votes
4
votes
The category is case sensitive as well. If your category is photo then it will look like this:
{% for post in site.categories.photo %}
# render the photo post html
{% endfor %}
If your category is Photo then it will look like this:
{% for post in site.categories.Photo %}
# render the photo post html
{% endfor %}
Just a quick detail that I tripped up on my build so I thought I would share.