Skip to content

Commit 1ff86bc

Browse files
committed
Refactor sponsors page to load the sponsors from the yml data.
1 parent 75a3237 commit 1ff86bc

4 files changed

Lines changed: 53 additions & 26 deletions

File tree

.plans/SPONSOR_PAGE_CHANGES.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,12 @@ Use `mkdocs-macros-plugin` to load a YAML data file and render the sponsors page
2626
- **Deduplicated structure:** sponsor details live once in a top-level `sponsors` map keyed by ID. Year entries under `years:` reference sponsors by ID only, so a sponsor returning across multiple years appears exactly once in the source.
2727
- 2026 and 2025 corporate entries populated from the existing sponsors page. `individual: []` empty lists in both years — no placeholder donors committed.
2828

29-
### 3. Rewrite the sponsors page template
30-
- Replace `docs/sponsors/index.md` with a Jinja2-templated version.
31-
- Top section: help/sponsorship info text (kept from current page). Decide whether to keep `SaturdayMP, the main Weekly Dev Chat sponsor` hardcoded or make it data-driven via a `primary_sponsor` field in the YAML. Hardcoded is fine for now — just call out the decision.
32-
- Iterate years newest-first with explicit sorting, not map iteration order:
33-
```jinja
34-
{% for year in sponsors.years.keys() | sort(reverse=true) %}
35-
```
36-
- For each year: corporate sponsors section, then individual donors section. For each ID in the year's list, look up the full record from the top-level `sponsors` map (e.g. `sponsors.sponsors[id]`). Skip + log a warning on unknown IDs so a typo fails loudly rather than silently dropping a sponsor.
37-
- Each sponsor/donor shows: image (if present), name, and link (if present). Use Jinja conditionals so missing fields don't render broken `<img>` tags or empty links.
38-
- Add alt text (`alt="{{ s.name }}"`) to every image — the existing page uses `![]()` with no alt, which is an accessibility gap worth fixing here.
39-
- Style consistent with existing hosts/past-hosts pages (150px float-left images).
29+
### 3. Rewrite the sponsors page template ✅
30+
- Replaced `docs/sponsors/index.md` with a Jinja2-templated version that preserves the top help/sponsorship text (SaturdayMP kept hardcoded).
31+
- Years iterated newest-first via `sponsors.years.keys() | sort(reverse=true)`.
32+
- For each year: Corporate Sponsors section; Individual Donors section rendered only when the list is non-empty. IDs are looked up in the top-level `sponsors` map; unknown IDs render a visible `> **WARNING:** ...` blockquote so typos fail loudly.
33+
- Image, name, and link are each rendered behind a Jinja conditional — missing optional fields don't produce broken tags or empty links.
34+
- Alt text added to every image. 150px float-left style matches the hosts/past-hosts pages, with a `<div style="clear: both;">` after each entry so floats don't collide.
4035

4136
### 4. Privacy / consent check
4237
- Before listing any individual by name, confirm they've opted in. Worth flagging to Chris as a launch gate.

data/sponsors.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@ sponsors:
4646
link_label: Edmonton Unlimited
4747
description: Thanks to Edmonton Unlimited for providing a Meetup Link.
4848

49+
chris:
50+
name: Chris
51+
description: Thanks to Chris for being an individual donor.
52+
4953
years:
5054
2026:
5155
corporate:
5256
- saturday-mp
5357
- dev-edmonton
5458
- edmonton-unlimited
55-
individual: []
59+
individual:
60+
- chris
5661

5762
2025:
5863
corporate:

docs/sponsors/index.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,52 @@ hide:
66

77
The best way you can help the Weekly Dev Chat is to attend the events as the kind, supportive, and respectful person you are. A close second is to share the Weekly Dev Chat with others who might benefit.
88

9-
We also need volunteers to help with a variety of tasks from helping with events, admin work, website maintenance, social media, etc. If you are interested in volunteering, please reach out to Chris via email at <chris.cumming@saturdaymp.com>.
9+
We also need volunteers to help with a variety of tasks from helping with events, admin work, website maintenance, social media, etc. If you are interested in volunteering, please reach out to Chris via email at <chris.cumming@saturdaymp.com>.
1010

11-
The final way you can help is by sponsoring SaturdayMP, the main Weekly Dev Chat sponsor, via GitHub [sponsors](https://github.com/sponsors/saturdaymp). Saturday MP pays for Zoom, hosting, food for in real life (IRL) events, and other expenses.
11+
The final way you can help is by sponsoring SaturdayMP, the main Weekly Dev Chat sponsor, via GitHub [sponsors](https://github.com/sponsors/saturdaymp). Saturday MP pays for Zoom, hosting, food for in real life (IRL) events, and other expenses.
1212

13-
If you have any other ideas for helping Weekly Dev Chat please give [Chris](mailto:chris.cumming@saturdaymp.com) a shout. Thank you for your help and support, it is much appreciated.
13+
If you have any other ideas for helping Weekly Dev Chat please give [Chris](mailto:chris.cumming@saturdaymp.com) a shout. Thank you for your help and support, it is much appreciated.
1414

15-
Sponsors
16-
--------
15+
{% for year in sponsors.years.keys() | sort(reverse=true) %}
16+
## {{ year }}
1717

18-
![](smp.jpeg){: style="width:150px;float: left;padding-right: 10px;"}
18+
### Corporate Sponsors
1919

20-
**Saturday Morning Productions**
20+
{% for id in sponsors.years[year].corporate %}
21+
{% if id in sponsors.sponsors %}
22+
{% set s = sponsors.sponsors[id] %}
23+
{% if s.image %}![{{ s.name }}]({{ s.image }}){: style="width:150px;float: left;padding-right: 10px;"}
24+
{% endif %}
25+
**{% if s.link %}[{{ s.name }}]({{ s.link }}){% else %}{{ s.name }}{% endif %}**
2126

22-
Thanks to [Saturday MP](https://saturdaymp.com/) for providing hosting, Zoom, and more.
27+
{% if s.description %}{{ s.description }}{% endif %}
2328

24-
![](devEd.png){: style="width:150px;float: left;padding-right: 10px;"}
29+
<div style="clear: both;"></div>
2530

26-
**Dev Edmonton Society**
31+
{% else %}
32+
> **WARNING:** Unknown sponsor ID `{{ id }}` referenced in `{{ year }}` corporate list. Check `data/sponsors.yml` for a typo.
2733
28-
Thanks to [DES](https://devedmonton.com/) for providing a Slack channel.
34+
{% endif %}
35+
{% endfor %}
2936

30-
![](EdmontonUnlimited.jpeg){: style="width:150px;float: left;padding-right: 10px;"}
37+
{% if sponsors.years[year].individual %}
38+
### Individual Donors
3139

32-
**Edmonton Unlimited**
40+
{% for id in sponsors.years[year].individual %}
41+
{% if id in sponsors.sponsors %}
42+
{% set s = sponsors.sponsors[id] %}
43+
{% if s.image %}![{{ s.name }}]({{ s.image }}){: style="width:150px;float: left;padding-right: 10px;"}
44+
{% endif %}
45+
**{% if s.link %}[{{ s.name }}]({{ s.link }}){% else %}{{ s.name }}{% endif %}**
3346

34-
Thanks to [Edmonton Unlimited](https://edmontonunlimited.com/) for providing a [Meetup Link](https://edmontonunlimited.com/).
47+
{% if s.description %}{{ s.description }}{% endif %}
48+
49+
<div style="clear: both;"></div>
50+
51+
{% else %}
52+
> **WARNING:** Unknown donor ID `{{ id }}` referenced in `{{ year }}` individual list. Check `data/sponsors.yml` for a typo.
53+
54+
{% endif %}
55+
{% endfor %}
56+
{% endif %}
57+
{% endfor %}

mkdocs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ nav:
4343

4444
exclude_docs: |
4545
past_topics.md
46+
47+
watch:
48+
- data
49+
4650
markdown_extensions:
4751
- attr_list # This lets us specify image dimensions, etc.
4852

0 commit comments

Comments
 (0)