Add talkEventName macro

This commit is contained in:
Oliver Davies 2019-12-27 19:48:16 +00:00
parent 2133af2a4a
commit 105ae345a9
2 changed files with 11 additions and 9 deletions

View file

@ -1,4 +1,12 @@
{% macro talkEventLocation(eventData, event) %}
{{ eventData.location ? 'in ' ~ eventData.location }}
{% macro talkEventName(event) %}
{% if event.url %}
<a href="{{ event.url }}">{{ event.name }}</a>
{% else %}
{{ event.name }}
{% endif %}
{% endmacro %}
{% macro talkEventLocation(event) %}
{{ event.location ? 'in ' ~ event.location }}
{{ event.online ? ' (online)' }}
{% endmacro %}

View file

@ -7,13 +7,7 @@
<ul class="markup list-disc ml-5">
{% for event in page.events if not event.date is empty %}
<li>
{% set eventData = site.events[event.event] %}
{% if eventData.url %}
<a href="{{ eventData.url }}">{{ eventData.name }}</a>
{% else %}
{{ eventData.name }}
{% endif %}
{{ helpers.talkEventLocation(eventData, event) }}
{{ helpers.talkEventName(event) }}
<span class="text-gray-800">- {{ event.date|date('jS F Y') }}</span>
</li>
{% endfor %}