Skip to content

Commit 11640f1

Browse files
committed
Updated to sponsors page plan to prevent duplicating sponsor info.
1 parent a83db1b commit 11640f1

1 file changed

Lines changed: 43 additions & 26 deletions

File tree

.plans/SPONSOR_PAGE_CHANGES.md

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ Use `mkdocs-macros-plugin` to load a YAML data file and render the sponsors page
2323
### 2. Create the YAML data file ✅
2424
- Created `data/sponsors.yml` using option (a) — data file outside `docs/`.
2525
- Header comment documents required/optional fields and the consent policy, with an example entry kept commented out for editor reference.
26+
- **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.
2627
- 2026 and 2025 corporate entries populated from the existing sponsors page. `individual: []` empty lists in both years — no placeholder donors committed.
2728

2829
### 3. Rewrite the sponsors page template
2930
- Replace `docs/sponsors/index.md` with a Jinja2-templated version.
3031
- 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.
3132
- Iterate years newest-first with explicit sorting, not map iteration order:
3233
```jinja
33-
{% for year in sponsors.sponsors.keys() | sort(reverse=true) %}
34+
{% for year in sponsors.years.keys() | sort(reverse=true) %}
3435
```
35-
- For each year: corporate sponsors section, then individual donors section, both rendered from data.
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.
3637
- 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.
3738
- Add alt text (`alt="{{ s.name }}"`) to every image — the existing page uses `![]()` with no alt, which is an accessibility gap worth fixing here.
3839
- Style consistent with existing hosts/past-hosts pages (150px float-left images).
@@ -53,45 +54,61 @@ Use `mkdocs-macros-plugin` to load a YAML data file and render the sponsors page
5354
## Data File Structure (Draft)
5455

5556
```yaml
56-
# docs/_data/sponsors.yml (or data/sponsors.yml — see step 2)
57-
# Corporate sponsors and individual donors organized by year.
58-
# Fields: name (required), image (optional), link (optional),
59-
# link_label (optional), description (optional).
57+
# data/sponsors.yml
58+
# Sponsor details are defined once under `sponsors:` and referenced by ID
59+
# in each year under `years:`. This avoids duplicating a sponsor's record
60+
# when they return across multiple years — update their info in one place.
61+
#
62+
# Sponsor fields: name (required), image (optional), link (optional),
63+
# link_label (optional), description (optional).
6064
# Policy: list individuals only with their explicit consent.
65+
6166
sponsors:
67+
saturday-mp:
68+
name: Saturday Morning Productions
69+
image: smp.jpeg
70+
link: https://saturdaymp.com/
71+
description: Thanks to Saturday MP for providing hosting, Zoom, and more.
72+
73+
dev-edmonton:
74+
name: Dev Edmonton Society
75+
image: devEd.png
76+
link: https://devedmonton.com/
77+
description: Thanks to DES for providing a Slack channel.
78+
79+
edmonton-unlimited:
80+
name: Edmonton Unlimited
81+
image: EdmontonUnlimited.jpeg
82+
link: https://edmontonunlimited.com/
83+
description: Thanks to Edmonton Unlimited for providing a Meetup Link.
84+
85+
years:
6286
2026:
6387
corporate:
64-
- name: Saturday Morning Productions
65-
image: smp.jpeg
66-
link: https://saturdaymp.com/
67-
description: Thanks to Saturday MP for providing hosting, Zoom, and more.
68-
69-
- name: Dev Edmonton Society
70-
image: devEd.png
71-
link: https://devedmonton.com/
72-
description: Thanks to DES for providing a Slack channel.
73-
74-
- name: Edmonton Unlimited
75-
image: EdmontonUnlimited.jpeg
76-
link: https://edmontonunlimited.com/
77-
description: Thanks to Edmonton Unlimited for providing a Meetup Link.
78-
88+
- saturday-mp
89+
- dev-edmonton
90+
- edmonton-unlimited
7991
individual: []
8092

8193
2025:
8294
corporate:
83-
- name: Saturday Morning Productions
84-
image: smp.jpeg
85-
link: https://saturdaymp.com/
86-
description: Thanks to Saturday MP for providing hosting, Zoom, and more.
87-
95+
- saturday-mp
8896
individual: []
8997
```
9098
99+
Example template lookup:
100+
```jinja
101+
{% for id in sponsors.years[year].corporate %}
102+
{% set s = sponsors.sponsors[id] %}
103+
...
104+
{% endfor %}
105+
```
106+
91107
## Key Decisions
92108
- **mkdocs-macros-plugin** chosen for Jinja2 templating in markdown (clean data/presentation separation).
93109
- **Corporate sponsors** and **individual donors** stored in same YAML file, organized by year.
94110
- **Corporate sponsors** for each year listed separately from **individual donors** on the page.
111+
- **Sponsor records deduplicated**: defined once under `sponsors:` by ID, referenced by ID from each year under `years:`. A returning sponsor is updated in one place.
95112
- **No placeholder donors** in committed data — start with empty lists.
96113
- **Images** stay in `docs/sponsors/`, referenced by filename in YAML.
97114
- **Existing help/volunteering text** at top of sponsors page is preserved.

0 commit comments

Comments
 (0)