jekyll variables, if functions

Viewed 283

Why is something like this not working ? i try to filter all posts from this year

<div class="tiles">
{% for post in site.categories.articles %}

  {% capture pubyear %} {{ post.date | date: "%Y" }} {% endcapture %}

    {% if pubyear == "2014" %}
      {% include post-grid.html %}
    {% endif %}

{% endfor %}
</div><!-- /.tiles -->
2 Answers
Related