From f91788120a94200db22e5ef57e9971a8fe24f24f Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 28 Jan 2016 21:47:30 +0000 Subject: [PATCH] Move talks back into one template --- source/_includes/previous-talks.html.twig | 23 -------- source/_includes/talk-listing-item.html.twig | 14 ++--- source/_includes/upcoming-talks.html.twig | 23 -------- source/talks.html.twig | 56 ++++++++++++++++++++ source/talks.md | 17 ------ 5 files changed, 64 insertions(+), 69 deletions(-) delete mode 100644 source/_includes/previous-talks.html.twig delete mode 100644 source/_includes/upcoming-talks.html.twig create mode 100644 source/talks.html.twig delete mode 100644 source/talks.md diff --git a/source/_includes/previous-talks.html.twig b/source/_includes/previous-talks.html.twig deleted file mode 100644 index b10d207d..00000000 --- a/source/_includes/previous-talks.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% set year = 0 %} - -{% for talk in data.talks if date(talk.date) < date('today') %} - {% if loop.first %} -

Previous Talks

- {% endif %} - - {% if talk.date|date('Y') != year %} - {% set year = talk.date|date('Y') %} - - -

{{ year }}

- -{% endif %} diff --git a/source/_includes/talk-listing-item.html.twig b/source/_includes/talk-listing-item.html.twig index e0301387..f97c1e69 100644 --- a/source/_includes/talk-listing-item.html.twig +++ b/source/_includes/talk-listing-item.html.twig @@ -1,6 +1,8 @@ -{{ talk.event.name }} - -{% if talk.fuzzy_date %} - {{ talk.title }} -{% else %} - {{ talk.title }} -{% endif %} +
  • + {{ talk.event.name }} - + {% if talk.fuzzy_date %} + {{ talk.title }} + {% else %} + {{ talk.title }} + {% endif %} +
  • diff --git a/source/_includes/upcoming-talks.html.twig b/source/_includes/upcoming-talks.html.twig deleted file mode 100644 index fd57dd2d..00000000 --- a/source/_includes/upcoming-talks.html.twig +++ /dev/null @@ -1,23 +0,0 @@ -{% set year = 0 %} - -{% for talk in data.talks if date(talk.date) >= date('today') %} - {% if loop.first %} -

    Upcoming Talks

    - {% endif %} - - {% if talk.date|date('Y') != year %} - {% set year = talk.date|date('Y') %} - - -

    {{ year }}

    - -{% endif %} diff --git a/source/talks.html.twig b/source/talks.html.twig new file mode 100644 index 00000000..053aa461 --- /dev/null +++ b/source/talks.html.twig @@ -0,0 +1,56 @@ +--- +layout: default +nav: talks +title: Talks +meta: + description: 'Information about previous and upcoming talks that Oliver has presented at conferences and user groups' +use: + - talks +--- +

    Talks

    + +

    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 get in touch.

    +

    There is also information about events that I’ve attended and spoken at on my Lanyrd and Joind.in profiles.

    + +{% set found = false %} +{% set year = 0 %} +{% set now = 'now'|date_modify('-2 days')|date('U') %} +{% for talk in data.talks if talk.date >= now %} + {% if loop.first %} + {% set found = true %} +

    Upcoming Talks

    + {% endif %} + + {% if talk.date|date('Y') != year %} + {% set year = talk.date|date('Y') %} + +

    {{ year }}

    + +{% endif %} + +{% set found = false %} +{% set year = 0 %} +{% for talk in data.talks if talk.date < now %} + {% if loop.first %} + {% set found = true %} +

    Previous Talks

    + {% endif %} + + {% if talk.date|date('Y') != year %} + {% set year = talk.date|date('Y') %} + +

    {{ year }}

    + +{% endif %} diff --git a/source/talks.md b/source/talks.md deleted file mode 100644 index 52a362ce..00000000 --- a/source/talks.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: default -nav: talks -title: Talks -meta: - description: 'Information about previous and upcoming talks that Oliver has presented at conferences and user groups' -use: - - talks ---- -# Talks - -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 get in touch. - -There is also information about events that I’ve attended and spoken at on my Lanyrd and Joind.in profiles. - -{{ include('upcoming-talks') }} -{{ include('previous-talks') }}