Move talks into separate include files
This commit is contained in:
parent
251fbb57d7
commit
b1ec837352
4 changed files with 60 additions and 75 deletions
23
source/_includes/previous-talks.html.twig
Normal file
23
source/_includes/previous-talks.html.twig
Normal 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 %}
|
|
@ -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 %}
|
||||
|
|
23
source/_includes/upcoming-talks.html.twig
Normal file
23
source/_includes/upcoming-talks.html.twig
Normal 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue