-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkshops.html
59 lines (56 loc) · 2.01 KB
/
workshops.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
is_workshops: true
layout: default
---
{% comment %} For date comparisons, see https://stackoverflow.com/a/23025858/3311770 {% endcomment %}
{% capture nowunix %}{{ 'now' | date: '%s' | plus: 0 }}{% endcapture %}
<section class="tone-dark">
<h1>{{ site.data.workshops.name }}</h1>
{{ site.data.workshops.description | markdownify }}
{% if site.data.workshops.calendar %}
<p>You can add our <a href="{{ site.data.workshops.calendar }}">calendar</a> to know about our events.</p>
{% endif %}
<div class="items-container">
{% for workshop in site.data.workshops.items %}
{% capture dateunix %}{{ workshop[1].date | date: '%s' | plus: 0 }}{% endcapture %}
{% if dateunix > nowunix %}
<div class="item-generic">
<h2>
<i>{{ workshop[0] }}</i>
</h2>
<p>{{ workshop[1].date | date: '%A %B %-d, %H:%M' }}</p>
<p>{{ workshop[1].description | markdownify }}</p>
<a href="{{ workshop[1].signup }}">Register</a>
</div>
{% endif %}
{% endfor %}
</div>
</section>
{% assign has_previous = false %}
{% for workshop in site.data.workshops.items %}
{% capture dateunix %}{{ workshop[1].date | date: '%s' | plus: 0 }}{% endcapture %}
{% if dateunix <= nowunix %}
{% assign has_previous = true %}
{% endif %}
{% endfor %}
{% if has_previous %}
<section>
<h1>Previous {{ site.data.workshops.name }}</h1>
<div class="items-container">
{% for workshop in site.data.workshops.items %}
{% capture dateunix %}{{ workshop[1].date | date: '%s' | plus: 0 }}{% endcapture %}
{% if dateunix <= nowunix %}
<div class="item-generic">
<h2>
<i>{{ workshop[0] }}</i>
</h2>
<p>{{ workshop[1].description | markdownify }}</p>
{% if workshop[1].material %}
<p><a href="{{ workshop[1].material }}">Workshop material</a></p>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
</section>
{% endif %}