I moved from Jekyll pre-1.0 to 2.0 recently.
In my original code, on each blog post it will list all the title of posts that belongs to the same category as the current post being viewed. Previously this code worked:
{% for post in site.categories.[page.category] %}
<li {% if page.title == post.title %} class="active" {% endif %}>
<a href="{{ post.url}}">{{ post.title }}</a></li>
{% endfor %}
However in the new version this does not work and I have to specify the category individually like so:
{% for post in site.categories.['NAME_OF_CATEGORY'] %}
Why can't I dynamically check for the category as before? And is there a work around for this instead of using if
statements?