Skip to content

Commit e4a1fbe

Browse files
authored
fix(og): put the landing model and integration cards on the brandbook template (#6913)
* fix(og): put the landing model and integration cards on the brandbook template The five models/integrations cards were the last ones still rendering the retired dark card with the green square-icon logo. They now share the cover renderer the library, docs, and shared-file cards use, which retires og-utils and the assets only it referenced. Captions wrap to two lines so a catalog description survives the move; the eyebrow, pill row, and domain label have no slot in the reference template and are dropped, with the counts they carried folded into the two index captions instead. * fix(og): drop the dead hard-space helper and restore the unknown-context copy withHardSpaces lost its last caller when captions moved onto wrapLines, which packs the non-breaking space inline; its rationale moves to wrapLines with it. A missing context window rendered as a bare "context window", reading as a field label mid-sentence. formatTokenCount already returns "Unknown" for a null value, so the ternary was both redundant and wrong.
1 parent 040f40c commit e4a1fbe

15 files changed

Lines changed: 119 additions & 474 deletions

File tree

apps/sim/app/(landing)/components/og-sim-logo/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/sim/app/(landing)/components/og-sim-logo/og-sim-logo.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
import integrationsJson from '@sim/deployment-config/integrations.json'
22
import { notFound } from 'next/navigation'
3-
import type { AuthType, Integration } from '@/lib/integrations/types'
4-
import { createLandingOgImage } from '@/app/(landing)/og-utils'
3+
import type { Integration } from '@/lib/integrations/types'
4+
import { COVER_OG_SIZE, createCoverOgImage } from '@/lib/og/cover-image'
55

66
export const contentType = 'image/png'
7-
export const size = {
8-
width: 1200,
9-
height: 630,
10-
}
7+
export const size = COVER_OG_SIZE
118

129
/** Raw catalog JSON, not the barrel - keeps `@/blocks/registry` out of the OG bundle. */
1310
const integrations = integrationsJson.integrations as readonly Integration[]
1411
const bySlug = new Map(integrations.map((i) => [i.slug, i]))
1512

16-
const AUTH_LABEL: Record<AuthType, string> = {
17-
oauth: 'One-click OAuth',
18-
'api-key': 'API key auth',
19-
none: 'No auth required',
20-
}
21-
2213
/**
2314
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
2415
* restriction that also blocks this metadata route from rendering any
@@ -38,22 +29,8 @@ export default async function Image({ params }: { params: Promise<{ slug: string
3829
notFound()
3930
}
4031

41-
const pills = [
42-
integration.operationCount > 0
43-
? `${integration.operationCount} tool${integration.operationCount === 1 ? '' : 's'}`
44-
: null,
45-
integration.triggerCount > 0
46-
? `${integration.triggerCount} real-time trigger${integration.triggerCount === 1 ? '' : 's'}`
47-
: null,
48-
AUTH_LABEL[integration.authType],
49-
'Free to start',
50-
].filter((pill): pill is string => pill !== null)
51-
52-
return createLandingOgImage({
53-
eyebrow: 'Sim integration',
32+
return createCoverOgImage({
5433
title: `${integration.name} Integration`,
5534
subtitle: integration.description,
56-
pills,
57-
domainLabel: `sim.ai/integrations/${slug}`,
5835
})
5936
}
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
11
import integrationsJson from '@sim/deployment-config/integrations.json'
22
import type { Integration } from '@/lib/integrations/types'
3-
import { createLandingOgImage } from '@/app/(landing)/og-utils'
3+
import { COVER_OG_SIZE, createCoverOgImage } from '@/lib/og/cover-image'
44

55
export const contentType = 'image/png'
6-
export const size = {
7-
width: 1200,
8-
height: 630,
9-
}
6+
export const size = COVER_OG_SIZE
107

118
/** Raw catalog JSON, not the barrel - keeps `@/blocks/registry` out of the OG bundle. */
129
const integrations = integrationsJson.integrations as readonly Integration[]
1310
const TOTAL_TOOL_COUNT = integrations.reduce((sum, i) => sum + i.operationCount, 0)
14-
const OAUTH_COUNT = integrations.filter((i) => i.authType === 'oauth').length
15-
const TRIGGER_INTEGRATION_COUNT = integrations.filter((i) => i.triggerCount > 0).length
1611

1712
export default async function Image() {
18-
return createLandingOgImage({
19-
eyebrow: 'Sim integrations directory',
13+
return createCoverOgImage({
2014
title: 'Integrations',
21-
subtitle: `Connect ${integrations.length} apps and services to AI agents in Sim's workflow builder, visually, conversationally, or with code.`,
22-
pills: [
23-
`${integrations.length} integrations`,
24-
`${TOTAL_TOOL_COUNT}+ tools`,
25-
`${OAUTH_COUNT} OAuth apps`,
26-
`${TRIGGER_INTEGRATION_COUNT} with real-time triggers`,
27-
],
28-
domainLabel: 'sim.ai/integrations',
15+
subtitle: `Connect ${integrations.length} apps and services and ${TOTAL_TOOL_COUNT}+ tools to AI agents in Sim — visually, conversationally, or with code.`,
2916
})
3017
}

apps/sim/app/(landing)/models/(shell)/[provider]/[model]/opengraph-image.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import { notFound } from 'next/navigation'
2+
import { COVER_OG_SIZE, createCoverOgImage } from '@/lib/og/cover-image'
23
import {
34
ALL_CATALOG_MODELS,
45
formatPrice,
56
formatTokenCount,
67
getModelBySlug,
78
getProviderBySlug,
89
} from '@/app/(landing)/models/utils'
9-
import { createLandingOgImage } from '@/app/(landing)/og-utils'
1010

1111
export const contentType = 'image/png'
12-
export const size = {
13-
width: 1200,
14-
height: 630,
15-
}
12+
export const size = COVER_OG_SIZE
1613

1714
/**
1815
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
@@ -41,16 +38,8 @@ export default async function Image({
4138
notFound()
4239
}
4340

44-
return createLandingOgImage({
45-
eyebrow: `${provider.name} model`,
41+
return createCoverOgImage({
4642
title: model.displayName,
47-
subtitle: `${provider.name} pricing, context window, and feature support generated from Sim's model registry.`,
48-
pills: [
49-
`Input ${formatPrice(model.pricing.input)}/1M`,
50-
`Output ${formatPrice(model.pricing.output)}/1M`,
51-
model.contextWindow ? `${formatTokenCount(model.contextWindow)} context` : 'Unknown context',
52-
model.capabilityTags[0] ?? 'Capabilities tracked',
53-
],
54-
domainLabel: `sim.ai${model.href}`,
43+
subtitle: `${provider.name} · ${formatPrice(model.pricing.input)}/1M in, ${formatPrice(model.pricing.output)}/1M out, ${formatTokenCount(model.contextWindow)} context — from Sim's model registry.`,
5544
})
5645
}
Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
import { notFound } from 'next/navigation'
2-
import {
3-
formatPrice,
4-
formatTokenCount,
5-
getCheapestProviderModel,
6-
getLargestContextProviderModel,
7-
getProviderBySlug,
8-
MODEL_PROVIDERS_WITH_CATALOGS,
9-
} from '@/app/(landing)/models/utils'
10-
import { createLandingOgImage } from '@/app/(landing)/og-utils'
2+
import { COVER_OG_SIZE, createCoverOgImage } from '@/lib/og/cover-image'
3+
import { getProviderBySlug, MODEL_PROVIDERS_WITH_CATALOGS } from '@/app/(landing)/models/utils'
114

125
export const contentType = 'image/png'
13-
export const size = {
14-
width: 1200,
15-
height: 630,
16-
}
6+
export const size = COVER_OG_SIZE
177

188
/**
199
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
@@ -36,21 +26,8 @@ export default async function Image({ params }: { params: Promise<{ provider: st
3626
notFound()
3727
}
3828

39-
const cheapestModel = getCheapestProviderModel(provider)
40-
const largestContextModel = getLargestContextProviderModel(provider)
41-
42-
return createLandingOgImage({
43-
eyebrow: `${provider.name} on Sim`,
29+
return createCoverOgImage({
4430
title: `${provider.name} models`,
45-
subtitle: `Browse ${provider.modelCount} tracked ${provider.name} models with pricing, context windows, default model selection, and model capability coverage.`,
46-
pills: [
47-
`${provider.modelCount} tracked`,
48-
provider.defaultModelDisplayName || 'Dynamic default',
49-
cheapestModel ? `From ${formatPrice(cheapestModel.pricing.input)}/1M` : 'Pricing tracked',
50-
largestContextModel?.contextWindow
51-
? `${formatTokenCount(largestContextModel.contextWindow)} context`
52-
: 'Context tracked',
53-
],
54-
domainLabel: `sim.ai${provider.href}`,
31+
subtitle: `Browse ${provider.modelCount} tracked ${provider.name} models with pricing, context windows, default model selection, and capability coverage.`,
5532
})
5633
}
Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
1-
import {
2-
formatTokenCount,
3-
MAX_CONTEXT_WINDOW,
4-
TOTAL_MODEL_PROVIDERS,
5-
TOTAL_MODELS,
6-
} from '@/app/(landing)/models/utils'
7-
import { createLandingOgImage } from '@/app/(landing)/og-utils'
1+
import { COVER_OG_SIZE, createCoverOgImage } from '@/lib/og/cover-image'
2+
import { TOTAL_MODEL_PROVIDERS, TOTAL_MODELS } from '@/app/(landing)/models/utils'
83

94
export const contentType = 'image/png'
10-
export const size = {
11-
width: 1200,
12-
height: 630,
13-
}
5+
export const size = COVER_OG_SIZE
146

157
export default async function Image() {
16-
return createLandingOgImage({
17-
eyebrow: 'Sim model directory',
8+
return createCoverOgImage({
189
title: 'AI Models Directory',
19-
subtitle:
20-
'Browse tracked AI models with pricing, context windows, and workflow-ready capability details.',
21-
pills: [
22-
`${TOTAL_MODELS} models`,
23-
`${TOTAL_MODEL_PROVIDERS} providers`,
24-
`${formatTokenCount(MAX_CONTEXT_WINDOW)} max context`,
25-
],
26-
domainLabel: 'sim.ai/models',
10+
subtitle: `Browse ${TOTAL_MODELS} models from ${TOTAL_MODEL_PROVIDERS} providers with pricing, context windows, and workflow-ready capability details.`,
2711
})
2812
}

apps/sim/app/(landing)/models/utils.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,6 @@ export const ALL_CATALOG_MODELS = MODEL_PROVIDERS_WITH_CATALOGS.flatMap(
589589
)
590590
export const TOTAL_MODEL_PROVIDERS = MODEL_CATALOG_PROVIDERS.length
591591
export const TOTAL_MODELS = ALL_CATALOG_MODELS.length
592-
export const MAX_CONTEXT_WINDOW = Math.max(
593-
...ALL_CATALOG_MODELS.map((model) => model.contextWindow ?? 0)
594-
)
595592
export const TOP_MODEL_PROVIDERS = MODEL_PROVIDERS_WITH_CATALOGS.slice(0, 8).map(
596593
(provider) => provider.name
597594
)

apps/sim/app/(landing)/og-utils.test.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)