Skip to content

Commit 482c8a0

Browse files
committed
build_hub_entries: emit per-brand tile bg_image (was blank)
1 parent d8f702c commit 482c8a0

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

migration-data/build_hub_entries.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,39 @@
8989
("code-beam-lite-mexico-2023", "code-beam-lite", "Code BEAM Mexico 2023", "2023-03-03", "3-4 MARCH 2023", "Mexico City", "https://codebeammexico.com/"),
9090
]
9191

92+
# Per-brand tile backgrounds (logo composited onto artwork; see uploads/).
93+
# Keeps regenerated entries branded instead of blank. elixirconf-brasil has no
94+
# logo asset yet, so it falls back to the neutral geometric.
95+
BG = {
96+
"lambda-days": "/uploads/lambda-days-bg.jpg",
97+
"code-beam-europe": "/uploads/code-beam-europe-tile.jpg",
98+
"code-beam-america": "/uploads/code-beam-america-tile.jpg",
99+
"code-beam-lite": "/uploads/code-beam-lite-bg.jpg",
100+
"code-mesh": "/uploads/code-mesh-bg.jpg",
101+
"code-elixir": "/uploads/code-elixir-ldn-bg.jpg",
102+
"elixirconf-eu": "/uploads/elixirconf-eu-bg.jpg",
103+
"elixirconf-us": "/uploads/elixirconf-us-bg.jpg",
104+
}
105+
NEUTRAL_BG = "/uploads/code-beam-europe-bg.jpg" # brand-neutral geometric fallback
106+
107+
108+
def bg_for(slug, brand):
109+
if slug.startswith("rabbitmq-summit"):
110+
return "/uploads/rabbitmq-summit-bg.jpg"
111+
if slug.startswith("mq-summit"):
112+
return "/uploads/mq-summit-tile.jpg"
113+
if slug.startswith("tech-mesh"):
114+
return "/uploads/tech-mesh-bg.jpg"
115+
return BG.get(brand, NEUTRAL_BG)
116+
117+
92118
ENTRY = """---
93119
conference_brand: _conference_brands/{brand}.md
94120
title: {title}
95121
conference_past_conferences: false
96122
past: true
97123
external_url: "{url}"
98-
bg_image: ''
124+
bg_image: "{bg}"
99125
logo_img: ''
100126
conference_location: "{loc}"
101127
conference_init_date: {date}T09:00:00.000+00:00
@@ -122,7 +148,8 @@ def main():
122148
skipped.append(slug)
123149
continue
124150
f.write_text(ENTRY.format(brand=brand, title=title, url=url,
125-
loc=loc, date=date, dates=dates), "utf-8")
151+
loc=loc, date=date, dates=dates,
152+
bg=bg_for(slug, brand)), "utf-8")
126153
created.append(slug)
127154
print(f"brand files created: {created_brands or 'none (all existed)'}")
128155
print(f"entries created ({len(created)}): {', '.join(created)}")

0 commit comments

Comments
 (0)