Skip to content

Commit 7095244

Browse files
committed
Enhance OG images with optimal information density
Add GitHub-style enhancements to social preview cards: NEW FEATURES: - Project logo display (80px, rounded, white background) - License badge (blue pill next to language) - India Connection badge (orange, shows founder/org/community/contributors) - Full location (City, State instead of just city) - Good first issues count (green badge, shows if > 0) INFORMATION NOW DISPLAYED (13+ data points): ✓ Project logo (visual identity) ✓ Project name (large, prominent) ✓ Primary language (TypeScript, Python, etc.) ✓ License (MIT, Apache-2.0, etc.) - NEW ✓ Location (Kolkata, West Bengal) - ENHANCED ✓ Verified badge (blue, conditional) ✓ India Connection (🇮🇳 Founder/Organization/etc.) - NEW ✓ Looking for contributors (green, conditional) ✓ Good first issues count (conditional) - NEW ✓ Short description (readable, gray) ✓ Tags (first 4 + counter) ✓ Stars count (yellow badge with emoji) ✓ Footer branding DESIGN IMPROVEMENTS: - Better visual hierarchy with logo - More semantic color coding - Richer metadata for developers - Unique India-focused value proposition - GitHub-style information density This makes FOSSRadar OG images more informative than GitHub's while maintaining clean, professional design.
1 parent aa2bed8 commit 7095244

File tree

1 file changed

+80
-7
lines changed

1 file changed

+80
-7
lines changed

app/projects/[slug]/opengraph-image.tsx

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default async function Image({ params }: { params: Promise<{ slug: string
4646
padding: "60px 80px",
4747
}}
4848
>
49-
{/* Project Name + Badges */}
49+
{/* Header with Logo + Project Name + Badges */}
5050
<div
5151
style={{
5252
display: "flex",
@@ -55,10 +55,34 @@ export default async function Image({ params }: { params: Promise<{ slug: string
5555
marginBottom: "24px",
5656
}}
5757
>
58-
<div style={{ fontSize: 64, fontWeight: 700, color: "#fff", maxWidth: "700px" }}>
59-
{project.name}
58+
<div style={{ display: "flex", gap: "20px", alignItems: "center", flex: 1, minWidth: 0 }}>
59+
{project.logo && (
60+
<div
61+
style={{
62+
width: "80px",
63+
height: "80px",
64+
borderRadius: "12px",
65+
backgroundColor: "#fff",
66+
display: "flex",
67+
alignItems: "center",
68+
justifyContent: "center",
69+
flexShrink: 0,
70+
padding: "12px",
71+
}}
72+
>
73+
<img
74+
src={`https://fossradar.in${project.logo}`}
75+
width="56"
76+
height="56"
77+
style={{ objectFit: "contain" }}
78+
/>
79+
</div>
80+
)}
81+
<div style={{ fontSize: 64, fontWeight: 700, color: "#fff", flex: 1, minWidth: 0 }}>
82+
{project.name}
83+
</div>
6084
</div>
61-
<div style={{ display: "flex", gap: "10px", flexShrink: 0 }}>
85+
<div style={{ display: "flex", gap: "10px", flexShrink: 0, flexWrap: "wrap", maxWidth: "400px", justifyContent: "flex-end" }}>
6286
{project.verified && (
6387
<div
6488
style={{
@@ -74,6 +98,25 @@ export default async function Image({ params }: { params: Promise<{ slug: string
7498
✓ Verified
7599
</div>
76100
)}
101+
{project.india_connection && (
102+
<div
103+
style={{
104+
padding: "8px 16px",
105+
backgroundColor: "#f97316",
106+
borderRadius: "8px",
107+
fontSize: 18,
108+
color: "#fff",
109+
fontWeight: 600,
110+
display: "flex",
111+
alignItems: "center",
112+
gap: "6px",
113+
}}
114+
>
115+
🇮🇳 {project.india_connection === "founder" ? "Founder" :
116+
project.india_connection === "organization" ? "Organization" :
117+
project.india_connection === "community" ? "Community" : "Contributors"}
118+
</div>
119+
)}
77120
{project.looking_for_contributors && (
78121
<div
79122
style={{
@@ -93,7 +136,7 @@ export default async function Image({ params }: { params: Promise<{ slug: string
93136
</div>
94137

95138
{/* Meta Info */}
96-
<div style={{ display: "flex", gap: "20px", marginBottom: "24px", flexWrap: "wrap" }}>
139+
<div style={{ display: "flex", gap: "20px", marginBottom: "24px", flexWrap: "wrap", alignItems: "center" }}>
97140
<div
98141
style={{
99142
padding: "6px 12px",
@@ -106,9 +149,39 @@ export default async function Image({ params }: { params: Promise<{ slug: string
106149
>
107150
{project.primary_lang}
108151
</div>
109-
<div style={{ fontSize: 16, color: "#94a3b8", display: "flex", alignItems: "center" }}>
110-
📍 {project.location_city}
152+
<div
153+
style={{
154+
padding: "6px 12px",
155+
backgroundColor: "#1e3a8a",
156+
borderRadius: "6px",
157+
fontSize: 16,
158+
color: "#93c5fd",
159+
display: "flex",
160+
fontWeight: 600,
161+
}}
162+
>
163+
{project.license}
164+
</div>
165+
<div style={{ fontSize: 16, color: "#94a3b8", display: "flex", alignItems: "center", fontWeight: 500 }}>
166+
📍 {project.location_city}, {project.location_indian_state}
111167
</div>
168+
{project.good_first_issues && project.good_first_issues > 0 && (
169+
<div
170+
style={{
171+
padding: "6px 12px",
172+
backgroundColor: "#065f46",
173+
borderRadius: "6px",
174+
fontSize: 16,
175+
color: "#6ee7b7",
176+
display: "flex",
177+
alignItems: "center",
178+
gap: "6px",
179+
fontWeight: 600,
180+
}}
181+
>
182+
{project.good_first_issues} good first issues
183+
</div>
184+
)}
112185
</div>
113186

114187
{/* Description */}

0 commit comments

Comments
 (0)