Refactor by removing temporary variables

This commit is contained in:
Oliver Davies 2017-10-28 14:24:33 +01:00
parent 168272a147
commit c65f94e4bc
3 changed files with 6 additions and 8 deletions

View file

@ -1,9 +1,8 @@
<div class="mt4">
<h2>Events</h2>
{% set data = { talks: [page], events: site.events } %}
{% include "talks-table" with {
talks: data|format_talks|reverse,
talks: { talks: [page], events: site.events }|format_talks|reverse,
talk_page: true
} %}
</div>

View file

@ -15,7 +15,8 @@ talks:
---
<p>Here are a list of my previous conference and user group talks:</p>
{% set data = { talks: data.talks|merge(page.talks), events: site.events } %}
{% include "talks-table" with { talks: data|format_talks(false, true) } %}
{% include "talks-table" with {
talks: { talks: data.talks|merge(page.talks), events: site.events }|format_talks(false, true)
} %}
<p>Upcoming talks can be found on the <a href="{{ site.url }}/talks">talks page</a>.</p>

View file

@ -8,11 +8,9 @@ use: [talks]
{% block content %}
<p>I regularly speak at conferences and user groups about a range of subjects including Drupal, Sculpin and Git. If you would like to me to speak at your group or conference, please <a href="{{ site.url }}/contact">get in touch</a>.</p>
{% set data = { talks: data.talks, events: site.events } %}
<h2>Upcoming Talks</h2>
{% set upcoming_talks = data|format_talks(true) %}
{% set upcoming_talks = { talks: data.talks, events: site.events }|format_talks(true) %}
{% if upcoming_talks %}
{% include "talks-table" with { talks: upcoming_talks } %}
{% else %}
@ -22,7 +20,7 @@ use: [talks]
<h2>Last 5 Talks</h2>
{% include "talks-table" with {
talks: data|format_talks(false, true)|slice(0,5)
talks: { talks: data.talks, events: site.events }|format_talks(false, true)|slice(0,5)
} %}
<p>All previous talks can be found in the <a href="{{ site.url }}/talks/archive">talks archive</a>.</p>