I am new using Jekyll and Jekyll-Bootstrap.
I have found this for filtering by category:
<ul class="posts">
{% for post in site.posts %}
{% if post.categories contains 'demography' %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
When I try to combine tags and categories it doesn't work:
<ul class="posts">
{% for post in site.posts %}
{% if post.categories contains 'demography' and post.tags contains 'R' %} %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
Any idea?
Thanks in advance!
You have a %}
too much in line #3.
Other than that, it should work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With