Batch entries by year? I have a press release index page that loops through all the press releases. I want to organize them by year. So everything in 2018 will have a header that says 2018 press releases and then all the press releases for 2018 and so on.

Should I do a conditional that checks the date, or is there something like the | batch but for date? Open to ideas.
You can use the group filter

{% set allEntries = craft.entries.section('blog').all() %}

{% set allEntriesByYear = allEntries|group('postDate.year') %}

{% for year, entriesInYear in allEntriesByYear %}
    &lt;h2&gt;{{ year }}&lt;/h2&gt;

    &lt;ul&gt;
        {% for entry in entriesInYear %}
            &lt;li&gt;&lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/li&gt;
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}