Extract includes from the talk layout
This commit is contained in:
parent
de2a1dcee3
commit
aad6d0315e
25
source/_includes/talk/events.html.twig
Normal file
25
source/_includes/talk/events.html.twig
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{% if events %}
|
||||||
|
<section>
|
||||||
|
<h2>Events</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for event in events|reverse %}
|
||||||
|
<li>
|
||||||
|
{% if event.url %}
|
||||||
|
<a href="{{ event.url }}">{{ event.name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ event.name }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if event.location %}
|
||||||
|
in {{ event.location }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
- {{ event.date|date('F jS, Y') }}
|
||||||
|
|
||||||
|
{{ event.online ? '(online)' }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
15
source/_includes/talk/slides.html.twig
Normal file
15
source/_includes/talk/slides.html.twig
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% if speakerdeck.id %}
|
||||||
|
<section>
|
||||||
|
<h2>Slides</h2>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<noscript>**Please enable JavaScript to view slides.**</noscript>
|
||||||
|
<script
|
||||||
|
class="speakerdeck-embed"
|
||||||
|
data-id="{{ speakerdeck.id }}"
|
||||||
|
data-ratio="{{ speakerdeck.ratio ?? '1.29456384323641' }}"
|
||||||
|
src="//speakerdeck.com/assets/embed.js"
|
||||||
|
></script>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
7
source/_includes/talk/video.html.twig
Normal file
7
source/_includes/talk/video.html.twig
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{% if video.type == 'youtube' and video.id %}
|
||||||
|
<section>
|
||||||
|
<h2>Video</h2>
|
||||||
|
|
||||||
|
{% include 'youtube-video.html.twig' with { id: video.id } %}
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
|
@ -3,53 +3,15 @@
|
||||||
{% block content_wrapper %}
|
{% block content_wrapper %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
|
|
||||||
{% if page.speakerdeck.id %}
|
{% include 'talk/slides' with {
|
||||||
<section>
|
speakerdeck: page.speakerdeck,
|
||||||
<h2>Slides</h2>
|
} %}
|
||||||
|
|
||||||
<div>
|
{% include 'talk/video' with {
|
||||||
<noscript>**Please enable JavaScript to view slides.**</noscript>
|
video: page.video,
|
||||||
<script
|
} %}
|
||||||
class="speakerdeck-embed"
|
|
||||||
data-id="{{ page.speakerdeck.id }}"
|
|
||||||
data-ratio="{{ page.speakerdeck.ratio ?? '1.29456384323641' }}"
|
|
||||||
src="//speakerdeck.com/assets/embed.js"
|
|
||||||
></script>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if page.video.type == 'youtube' and page.video.id %}
|
{% include 'talk/events' with {
|
||||||
<section>
|
events: page.events,
|
||||||
<h2>Video</h2>
|
} %}
|
||||||
|
|
||||||
{% include 'youtube-video.html.twig' with { id: page.video.id } %}
|
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if page.events %}
|
|
||||||
<section>
|
|
||||||
<h2>Events</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
{% for event in page.events|reverse %}
|
|
||||||
<li>
|
|
||||||
{% if event.url %}
|
|
||||||
<a href="{{ event.url }}">{{ event.name }}</a>
|
|
||||||
{% else %}
|
|
||||||
{{ event.name }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if event.location %}
|
|
||||||
in {{ event.location }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
- {{ event.date|date('F jS, Y') }}
|
|
||||||
|
|
||||||
{{ event.online ? '(online)' }}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue