/
badges.html
57 lines (54 loc) · 2.28 KB
/
badges.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
---
layout: page
title: Badges
---
<h1 class="my-4">Badges (by year)</h1>
<!-- list each badge -->
<!-- for each, list each year from 2022 to site publish date -->
<!-- for each year, list each participant and the first episode they appeared in that year -->
{% assign currentYear = site.time | date: "%Y" -%}
{%- assign episodesByYear = site.episodes | where: "posted", true | group_by_exp: "item", "item.date | date: '%Y' | plus: 0" -%}
{% for badge in site.data.badges -%}
<h2 class="mt-5">{{ badge[1].name }}</h2>
<p>{{ badge[1].description }} </p>
{% for year in (2022..currentYear) -%}
{% assign episodesThisYear = '' | split: '' -%}
{% for group in episodesByYear -%}
{% if group.name == year -%}
{% assign episodesThisYear = group.items -%}
<h3 class="mt-5">{{ year }}</h3>
<table class="table">
<tr><th>Participant</th><th>First achieved</th><th>Ethereum</th></tr>
{% for participant in site.data.participants -%}
{% for episode in episodesThisYear -%}
{% assign foundBadge = episode.badges | where: "participant", participant[0] | where: "type", badge[0] -%}
{% if foundBadge.size > 0 -%}
{% assign participantData = "" -%}
{% for participantDataSearching in site.data.participants -%}
{% if participantDataSearching[0] == participant[0] -%}
{% assign participantData = participantDataSearching -%}
{% break -%}
{% endif -%}
{% endfor -%}
<tr>
<td class="position-relative">
<a href="https://twitter.com/{{ participant[0] }}" class="stretched-link">
{{ participant[0] }}
</a>
</td>
<td>{{ episode.date | date: "%Y-%m-%d" }}</td>
<td>
{% if participantData[1].ethereum == "???" -%}
{% else -%}
{{ participantData[1].ethereum }}
{% endif -%}
</tr>
{% break %}
{% endif -%}
{% endfor -%}
{% endfor %}
</table>
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}