Skip to content

Commit 086982c

Browse files
authored
improvement(docs): update og image (#2529)
1 parent 2b7807a commit 086982c

File tree

3 files changed

+16
-50
lines changed

3 files changed

+16
-50
lines changed

apps/docs/app/[lang]/[[...slug]]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ export async function generateMetadata(props: {
258258
const baseUrl = 'https://docs.sim.ai'
259259
const fullUrl = `${baseUrl}${page.url}`
260260

261-
const description = data.description || ''
262-
const ogImageUrl = `${baseUrl}/api/og?title=${encodeURIComponent(data.title)}&category=DOCUMENTATION${description ? `&description=${encodeURIComponent(description)}` : ''}`
261+
const ogImageUrl = `${baseUrl}/api/og?title=${encodeURIComponent(data.title)}`
263262

264263
return {
265264
title: data.title,

apps/docs/app/api/og/route.tsx

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ async function loadGoogleFont(font: string, weights: string, text: string): Prom
3939
export async function GET(request: NextRequest) {
4040
const { searchParams } = new URL(request.url)
4141
const title = searchParams.get('title') || 'Documentation'
42-
const category = searchParams.get('category') || 'DOCUMENTATION'
43-
const description = searchParams.get('description') || ''
4442

4543
const baseUrl = new URL(request.url).origin
4644

47-
const allText = `${title}${category}${description}docs.sim.ai`
45+
const allText = `${title}docs.sim.ai`
4846
const fontData = await loadGoogleFont('Geist', '400;500;600', allText)
4947

5048
return new ImageResponse(
@@ -59,7 +57,7 @@ export async function GET(request: NextRequest) {
5957
fontFamily: 'Geist',
6058
}}
6159
>
62-
{/* Base gradient layer - very subtle purple tint across the entire image */}
60+
{/* Base gradient layer - subtle purple tint across the entire image */}
6361
<div
6462
style={{
6563
position: 'absolute',
@@ -114,56 +112,25 @@ export async function GET(request: NextRequest) {
114112
{/* Logo */}
115113
<img src={`${baseUrl}/static/logo.png`} alt='sim' height={32} />
116114

117-
{/* Category + Title + Description */}
118-
<div
115+
{/* Title */}
116+
<span
119117
style={{
120-
display: 'flex',
121-
flexDirection: 'column',
122-
gap: 12,
118+
fontSize: getTitleFontSize(title),
119+
fontWeight: 600,
120+
color: '#ffffff',
121+
lineHeight: 1.1,
122+
letterSpacing: '-0.02em',
123123
}}
124124
>
125-
<span
126-
style={{
127-
fontSize: 15,
128-
fontWeight: 600,
129-
color: '#802fff',
130-
letterSpacing: '0.02em',
131-
}}
132-
>
133-
{category}
134-
</span>
135-
<span
136-
style={{
137-
fontSize: getTitleFontSize(title),
138-
fontWeight: 600,
139-
color: '#ffffff',
140-
lineHeight: 1.1,
141-
letterSpacing: '-0.02em',
142-
}}
143-
>
144-
{title}
145-
</span>
146-
{description && (
147-
<span
148-
style={{
149-
fontSize: 18,
150-
fontWeight: 400,
151-
color: '#a1a1aa',
152-
lineHeight: 1.4,
153-
marginTop: 4,
154-
}}
155-
>
156-
{description.length > 100 ? `${description.slice(0, 100)}...` : description}
157-
</span>
158-
)}
159-
</div>
125+
{title}
126+
</span>
160127

161128
{/* Footer */}
162129
<span
163130
style={{
164-
fontSize: 15,
131+
fontSize: 20,
165132
fontWeight: 500,
166-
color: '#52525b',
133+
color: '#71717a',
167134
}}
168135
>
169136
docs.sim.ai

apps/docs/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const metadata = {
5858
'Comprehensive documentation for Sim - the visual workflow builder for AI applications. Create powerful AI agents, automation workflows, and data processing pipelines.',
5959
images: [
6060
{
61-
url: 'https://docs.sim.ai/api/og?title=Sim%20Documentation&category=DOCUMENTATION',
61+
url: 'https://docs.sim.ai/api/og?title=Sim%20Documentation',
6262
width: 1200,
6363
height: 630,
6464
alt: 'Sim Documentation',
@@ -72,7 +72,7 @@ export const metadata = {
7272
'Comprehensive documentation for Sim - the visual workflow builder for AI applications.',
7373
creator: '@simdotai',
7474
site: '@simdotai',
75-
images: ['https://docs.sim.ai/api/og?title=Sim%20Documentation&category=DOCUMENTATION'],
75+
images: ['https://docs.sim.ai/api/og?title=Sim%20Documentation'],
7676
},
7777
robots: {
7878
index: true,

0 commit comments

Comments
 (0)