Add talkEventLocation macro
This commit is contained in:
parent
9d63ec82a7
commit
9b2106e586
5
source/_layouts/helpers.html.twig
Normal file
5
source/_layouts/helpers.html.twig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{% macro talkEventLocation(eventData, event) %}
|
||||||
|
{% if eventData.location %}
|
||||||
|
in {{ eventData.location }}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
|
@ -1,3 +1,5 @@
|
||||||
|
{% import 'helpers' as helpers %}
|
||||||
|
|
||||||
{% if page.events %}
|
{% if page.events %}
|
||||||
<div>
|
<div>
|
||||||
<h2 class="mb-2">Presented at</h2>
|
<h2 class="mb-2">Presented at</h2>
|
||||||
|
@ -11,9 +13,7 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ eventData.name }}
|
{{ eventData.name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if eventData.location %}
|
{{ helpers.talkEventLocation(eventData, event) }}
|
||||||
in {{ eventData.location }}
|
|
||||||
{% endif %}
|
|
||||||
<span class="text-gray-800">- {{ event.date|date('jS F Y') }}</span>
|
<span class="text-gray-800">- {{ event.date|date('jS F Y') }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Reference in a new issue