Split talk layout into partials
This commit is contained in:
parent
e883696526
commit
e1dbd21ef2
20
source/_includes/talk/events.html.twig
Normal file
20
source/_includes/talk/events.html.twig
Normal file
|
@ -0,0 +1,20 @@
|
|||
<div class="mt4">
|
||||
<h2>Events</h2>
|
||||
|
||||
{% set events = [] %}
|
||||
{% for date in site.events.dates %}
|
||||
{% set key = (date.talk.id is defined) ? date.talk.id : date.talk %}
|
||||
{% set talk = (page.id is defined) ? page.id : page.url|split('/')|last %}
|
||||
{% if key == talk %}
|
||||
{% set events = events|merge([{
|
||||
date: date,
|
||||
event: site.events.events[date.event],
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include 'talks-table' with {
|
||||
events: events,
|
||||
talk_page: true,
|
||||
} %}
|
||||
</div>
|
8
source/_includes/talk/slides.html.twig
Normal file
8
source/_includes/talk/slides.html.twig
Normal file
|
@ -0,0 +1,8 @@
|
|||
{% if page.slides.embed %}
|
||||
<div class="mt2">
|
||||
<h2>Slides</h2>
|
||||
<div class="slides w-100 bg-center">
|
||||
{{ page.slides.embed|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
9
source/_includes/talk/video.html.twig
Normal file
9
source/_includes/talk/video.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% if page.video.embed %}
|
||||
<div class="mt2">
|
||||
<h2>Video</h2>
|
||||
|
||||
<div class="video w-100 pa0 relative">
|
||||
{{ page.video.embed|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
|
@ -5,45 +5,9 @@
|
|||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
{% if page.slides.embed %}
|
||||
<div class="mt2">
|
||||
<h2>Slides</h2>
|
||||
<div class="slides w-100 bg-center">
|
||||
{{ page.slides.embed|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if page.video.embed %}
|
||||
<div class="mt2">
|
||||
<h2>Video</h2>
|
||||
|
||||
<div class="video w-100 pa0 relative">
|
||||
{{ page.video.embed|raw }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt4">
|
||||
<h2>Events</h2>
|
||||
|
||||
{% set events = [] %}
|
||||
{% for date in site.events.dates %}
|
||||
{% set key = (date.talk.id is defined) ? date.talk.id : date.talk %}
|
||||
{% set talk = (page.id is defined) ? page.id : page.url|split('/')|last %}
|
||||
{% if key == talk %}
|
||||
{% set events = events|merge([{
|
||||
date: date,
|
||||
event: site.events.events[date.event],
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% include 'talks-table' with {
|
||||
events: events,
|
||||
talk_page: true,
|
||||
} %}
|
||||
</div>
|
||||
{% include 'talk/slides' %}
|
||||
{% include 'talk/video' %}
|
||||
{% include 'talk/events' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
|
|
Reference in a new issue