Re-add talk templates and partials
This commit is contained in:
parent
d31410792b
commit
814dd9d97e
|
@ -1 +1,7 @@
|
||||||
{% extends "default" %}
|
{% extends "default" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>{{ page.title }}</h1>
|
||||||
|
|
||||||
|
{{ parent() }}
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -1 +1,18 @@
|
||||||
{% extends "default" %}
|
{% extends "page.html.twig" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ parent() }}
|
||||||
|
|
||||||
|
{% include 'talk/slides' with {
|
||||||
|
speakerdeck: page.speakerdeck,
|
||||||
|
} only %}
|
||||||
|
|
||||||
|
{% include 'talk/video' with {
|
||||||
|
video: page.video,
|
||||||
|
} only %}
|
||||||
|
|
||||||
|
{% include 'talk/events' with {
|
||||||
|
events: page.events|reverse,
|
||||||
|
} only %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
17
source/_pages/talks.html.twig
Normal file
17
source/_pages/talks.html.twig
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
title: Talks and Workshops
|
||||||
|
use:
|
||||||
|
- talks
|
||||||
|
---
|
||||||
|
|
||||||
|
{% for talk in data.talks|sort((a,b) => a.sortable_date < b.sortable_date) %}
|
||||||
|
<article>
|
||||||
|
<h2>
|
||||||
|
<a href="{{ talk.url }}">
|
||||||
|
{{ talk.title }}
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<p>{{ talk.description }}</p>
|
||||||
|
</article>
|
||||||
|
{% endfor %}
|
15
source/_partials/talk/events.html.twig
Normal file
15
source/_partials/talk/events.html.twig
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{% if events is not empty %}
|
||||||
|
<h2>Events</h2>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for event in events %}
|
||||||
|
{% include 'talk/events/event.html.twig' with {
|
||||||
|
date: event.date,
|
||||||
|
is_online: event.is_online ?? false,
|
||||||
|
location: event.location,
|
||||||
|
name: event.name,
|
||||||
|
url: event.url,
|
||||||
|
} only %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
10
source/_partials/talk/events/event.html.twig
Normal file
10
source/_partials/talk/events/event.html.twig
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<li>
|
||||||
|
{% if url %}
|
||||||
|
<a href="{{ url }}">{{ name }}</a>
|
||||||
|
{% else %}
|
||||||
|
{{ name }}
|
||||||
|
{% endif %}
|
||||||
|
{% if location %}in {{ location }}{% endif %}
|
||||||
|
{{ is_online ? '(Online)' }}
|
||||||
|
- {{ date|date('jS F Y') }}
|
||||||
|
</li>
|
9
source/_partials/talk/slides.html.twig
Normal file
9
source/_partials/talk/slides.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{% if speakerdeck.id and speakerdeck.ratio %}
|
||||||
|
<div>
|
||||||
|
<h2 class="mb-2">Slides</h2>
|
||||||
|
|
||||||
|
{% include 'talk/speakerdeck' with {
|
||||||
|
data: speakerdeck,
|
||||||
|
} only %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
9
source/_partials/talk/speakerdeck.html.twig
Normal file
9
source/_partials/talk/speakerdeck.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<div class="slides">
|
||||||
|
<noscript>**Please enable JavaScript to view slides.**</noscript>
|
||||||
|
<script
|
||||||
|
class="speakerdeck-embed"
|
||||||
|
data-id="{{ data.id }}"
|
||||||
|
data-ratio="{{ data.ratio ?: '1.29456384323641' }}"
|
||||||
|
src="//speakerdeck.com/assets/embed.js"
|
||||||
|
></script>
|
||||||
|
</div>
|
28
source/_partials/talk/video.html.twig
Normal file
28
source/_partials/talk/video.html.twig
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{% macro videoSrc(video) %}
|
||||||
|
{% set srcUrls = {
|
||||||
|
youtube: '//www.youtube.com/embed',
|
||||||
|
videopress: 'https://videopress.com/embed',
|
||||||
|
vimeo: 'https://player.vimeo.com/video',
|
||||||
|
} %}
|
||||||
|
|
||||||
|
{{ srcUrls[video.type] ~ '/' ~ video.id }}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% from _self import videoSrc %}
|
||||||
|
|
||||||
|
{% if video.id %}
|
||||||
|
<div class="mt-4">
|
||||||
|
<h2 class="mb-2">Video</h2>
|
||||||
|
|
||||||
|
<div class="video-full">
|
||||||
|
<iframe
|
||||||
|
width="678"
|
||||||
|
height="408"
|
||||||
|
src="{{ videoSrc(video) }}"
|
||||||
|
frameborder="0"
|
||||||
|
allowfullscreen
|
||||||
|
>
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
Loading…
Reference in a new issue