Move talks into separate include files

This commit is contained in:
Oliver Davies 2015-10-22 00:23:34 +01:00
parent 251fbb57d7
commit b1ec837352
4 changed files with 60 additions and 75 deletions

View file

@ -0,0 +1,23 @@
{% set year = 0 %}
{% for talk in data.talks if date(talk.date) < date('today') %}
{% if loop.first %}
<h2>Previous Talks</h2>
{% endif %}
{% if talk.date|date('Y') != year %}
{% set year = talk.date|date('Y') %}
</ul>
<h3>{{ year }}</h3>
<ul>
{% endif %}
<li>
{{- include('talk-listing-item') -}}
</li>
{% endfor %}
{% if year != 0 %}
</ul>
{% endif %}

View file

@ -1,15 +1,13 @@
<li>
<strong>{% spaceless %}
{% if talk.fuzzy_date %}
{{ talk.date|date('F') }}
{% else %}
{{ talk.date|date('jS F') }}
{% endif %}
{% endspaceless %}</strong> - {{ talk.event.name }}
-
<strong>{% spaceless %}
{% if talk.fuzzy_date %}
{{ talk.title }}
{{ talk.date|date('F') }}
{% else %}
<a href="{{ talk.url }}">{{ talk.title }}</a>
{{ talk.date|date('jS F') }}
{% endif %}
</li>
{% endspaceless %}</strong> - {{ talk.event.name }}
-
{% if talk.fuzzy_date %}
{{ talk.title }}
{% else %}
<a href="{{ talk.url }}">{{ talk.title }}</a>
{% endif %}

View file

@ -0,0 +1,23 @@
{% set year = 0 %}
{% for talk in data.talks if date(talk.date) >= date('today') %}
{% if loop.first %}
<h2>Upcoming Talks</h2>
{% endif %}
{% if talk.date|date('Y') != year %}
{% set year = talk.date|date('Y') %}
</ul>
<h3>{{ year }}</h3>
<ul>
{% endif %}
<li>
{{- include('talk-listing-item') -}}
</li>
{% endfor %}
{% if year != 0 %}
</ul>
{% endif %}