Group talks by year
This commit is contained in:
parent
550de135f0
commit
c7e3e36661
|
@ -27,14 +27,21 @@ talks:
|
||||||
{% set talks = page.talks|reverse %}
|
{% set talks = page.talks|reverse %}
|
||||||
|
|
||||||
{% set found = false %}
|
{% set found = false %}
|
||||||
|
{% set year = '0' %}
|
||||||
{% for talk in talks|reverse if talk.date >= now %}
|
{% for talk in talks|reverse if talk.date >= now %}
|
||||||
{% set found = true %}
|
{% set found = true %}
|
||||||
{% if loop.first %}
|
{% if loop.first %}
|
||||||
<h2>Upcoming Talks</h2>
|
<h2>Upcoming Talks</h2>
|
||||||
<ul>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include 'talk-listing-item' %}
|
{% set this_year %}{{ talk.date|date('Y') }}{% endset %}
|
||||||
|
{% if this_year != year %}
|
||||||
|
<h3>{{ this_year }}</h3>
|
||||||
|
{% set year = this_year %}
|
||||||
|
{% endif %}
|
||||||
|
{{ talk.title }}<br>
|
||||||
|
|
||||||
|
<!--{% include 'talk-listing-item' %}-->
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if found %}
|
{% if found %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -42,15 +49,17 @@ talks:
|
||||||
|
|
||||||
{% set found = false %}
|
{% set found = false %}
|
||||||
{% for talk in talks if talk.date < now %}
|
{% for talk in talks if talk.date < now %}
|
||||||
{% set found = true %}
|
|
||||||
{% if loop.first %}
|
{% if loop.first %}
|
||||||
<h2>Previous Talks</h2>
|
<h2>Previous Talks</h2>
|
||||||
<ul>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include 'talk-listing-item' %}
|
{% set this_year %}{{ talk.date|date('Y') }}{% endset %}
|
||||||
{% endfor %}
|
{% if this_year != year %}
|
||||||
{% if found %}
|
<h3>{{ this_year }}</h3>
|
||||||
</ul>
|
{% set year = this_year %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{{ talk.title }}<br>
|
||||||
|
|
||||||
|
<!-- {% include 'talk-listing-item' %} -->
|
||||||
|
{% endfor %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Reference in a new issue