In Jekyll, I have a small blog system going with two categories: blog and portfolio. I have two pages that will render the posts for these categories, with a for loop that looks something like this:
{% for post in site.categories['blog'] %}
…
{% endfor %}
On my home page, I want to show the latest post in the blog category. However, I want my blog to contain some of my photography too - these will exist as posts, but most of the time they have no title or body content - they are just an image. I do not want those posts to show up on the home page.
Effectively, I only want the latest blog post to show up on the home page, excluding all photography posts. I am considering my options for this:
- Use two categories:
blogandphotos. However, how would I then make my blog page show posts from both of these categories? I would effectively need to merge the arrayssite.categories['blog']andsite.categories['photos'], and put those into aforloop - but is that possible? - Keep one category:
blog, but in some other way, exclude posts without a title from appearing on the home page. But how do you do that?
Is this possible?