Skip to content

Commit 1949e65

Browse files
authored
adds accordion with all events to page (#740)
1 parent 49ce22a commit 1949e65

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

_data/sponsored_events.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"2024": ["PyTexas", "PyOhio", "PyCon Africa", "PyCon South Africa", "PyCon Zimbabwe", "PyCon Nigeria", "IndabaX - Botswana", "PyCon Uganda", "PyHo - Ghana"],
2+
"2024": {
3+
"Africa": ["PyCon Africa", "PyCon South Africa", "PyCon Zimbabwe", "PyCon Nigeria", "IndabaX - Botswana", "PyCon Uganda", "PyHo - Ghana"],
4+
"North America": ["PyTexas", "PyOhio"]
5+
},
36
"2025": {
47
"Africa": ["Django Girls - Ho", "PyCon Africa", "DjangoCon Africa", "IndabaX - Botswana", "PyCon Namibia", "PyTogo", "Zero to Hero Mentorship Program - Nigeria"],
58
"North America": ["PyTexas Foundation", "PyOhio", "PyBeach"],

_layouts/sponsored-events.html

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,28 @@ <h1>Supported Events</h1>
1414
<p>Here is a look at events this year that we've supported:</p>
1515
</section>
1616

17+
1718
<section>
18-
<h2>Events Sponsored in {{year}}</h2>
19-
<section class="grid">
20-
{% for segment in data[year] | sort %}
21-
<article>
22-
<h3>{{segment}}</h3>
23-
{% for event in data[year][segment] | sort %}
24-
<p>{{event}}</p>
19+
<h2>Events Sponsored by year</h2>
20+
{% for segment_year in data | sort(reverse=True) %}
21+
{% if segment_year == year %}
22+
<details name="{{segment_year}}" open>
23+
{% else %}
24+
<details name="{{segment_year}}">
25+
{% endif %}
26+
<summary>{{segment_year}}</summary>
27+
<section class="grid">
28+
{% for segment in data[segment_year] | sort %}
29+
<article>
30+
<h3>{{segment}}</h3>
31+
{% for event in data[segment_year][segment] | sort %}
32+
<p>{{event}}</p>
33+
{% endfor %}
34+
</article>
2535
{% endfor %}
26-
</article>
36+
</section>
37+
</details>
38+
<hr/>
2739
{% endfor %}
2840
</section>
2941

0 commit comments

Comments
 (0)