Issue ID: thewodapp-0fa
Status: Closed
Priority: P2
Add dynamic Open Graph images for competition pages that display competition-specific branding, dates, and registration status.
- Competition page at
/compete/[slug]/page.tsxhas basicgenerateMetadata - OG image uses generic route:
/api/og?title={name} - Competition schema has:
profileImageUrl,bannerImageUrl,name,description,startDate,endDate,registrationOpensAt,registrationClosesAt
| Field | Usage |
|---|---|
competition.profileImageUrl |
Logo (fallback to wodsmith logo) |
competition.name |
Title |
competition.startDate / endDate |
Competition dates |
competition.registrationOpensAt / registrationClosesAt |
Registration badge |
apps/wodsmith/src/app/api/og/competition/route.tsx
apps/wodsmith/src/app/(compete)/compete/[slug]/page.tsx(generateMetadata only)
- Competition page generates OG URL:
/api/og/competition?slug={slug} - OG route calls
getCompetition(slug)to fetch data - Renders
ImageResponsewith competition branding
Issue ID: thewodapp-0fa.1
slug(required) - competition slug used to fetch competition data
-
Logo section (top-left)
- Use
competition.profileImageUrlif set - Fall back to
SITE_URL/wodsmith-logo-no-text.png
- Use
-
Title section
competition.nameprominently displayed
-
Dates section
- Competition dates:
startDate-endDate(always shown) - Format:
MMM DD - DD, YYYYorMMM DD, YYYYfor single-day events
- Competition dates:
-
Registration badge (conditional)
- Show if
registrationOpensAtandregistrationClosesAtare set - States:
Registration Open,Opens {date},Registration Closed - Include registration dates when open
- Show if
┌────────────────────────────────────────────────────────────┐
│ │
│ ┌──────┐ │
│ │ LOGO │ Competition Title │
│ └──────┘ (large, bold) │
│ │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ 📅 Jan 15 - 17, 2026 │ │
│ │ │ │
│ │ Registration Open: Dec 1 - Jan 10 │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ [wodsmith logo] Wodsmith │
│▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓│
└────────────────────────────────────────────────────────────┘
| State | Color | Display |
|---|---|---|
| Open | Green | Registration Open: Dec 1 - Jan 10 |
| Opens soon | Yellow | Registration Opens Dec 1 |
| Closed | Gray | Registration Closed |
| No registration | - | Badge omitted |
Issue ID: thewodapp-0fa.2
Depends on: thewodapp-0fa.1
Update /compete/[slug]/page.tsx generateMetadata function:
// Before
url: `/api/og?title=${encodeURIComponent(competition.name)}`
// After
url: `/api/og/competition?slug=${encodeURIComponent(slug)}`- Approach: Fetch competition data in OG route (Option A)
- Cleaner URLs
- Always fresh data
- Can add caching if needed
- Calendar icon uses SVG (white
#e5e5e5to match text) - Single-day events display as
Dec 18, 2025instead ofDec 18 - 18, 2025 - Registration status badges have no indicator dots (clean text only)