Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ const AUTH_LABEL: Record<AuthType, string> = {
none: 'No auth required',
}

/**
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
* restriction that also blocks this metadata route from rendering any
* param combination it wasn't statically generated for - but Next does not
* share generateStaticParams between a page and its sibling metadata
* routes, so without this export every integration's OG image 404s.
*/
export async function generateStaticParams() {
return integrations.map((integration) => ({ slug: integration.slug }))
}

export default async function Image({ params }: { params: Promise<{ slug: string }> }) {
const { slug } = await params
const integration = bySlug.get(slug)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { notFound } from 'next/navigation'
import {
ALL_CATALOG_MODELS,
formatPrice,
formatTokenCount,
getModelBySlug,
Expand All @@ -13,6 +14,20 @@ export const size = {
height: 630,
}

/**
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
* restriction that also blocks this metadata route from rendering any
* param combination it wasn't statically generated for - but Next does not
* share generateStaticParams between a page and its sibling metadata
* routes, so without this export every model's OG image 404s.
*/
export async function generateStaticParams() {
return ALL_CATALOG_MODELS.map((model) => ({
provider: model.providerSlug,
model: model.slug,
}))
}

export default async function Image({
params,
}: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
getCheapestProviderModel,
getLargestContextProviderModel,
getProviderBySlug,
MODEL_PROVIDERS_WITH_CATALOGS,
} from '@/app/(landing)/models/utils'
import { createLandingOgImage } from '@/app/(landing)/og-utils'

Expand All @@ -14,6 +15,19 @@ export const size = {
height: 630,
}

/**
* The sibling page.tsx sets `dynamicParams = false`, a segment-level
* restriction that also blocks this metadata route from rendering any
* param combination it wasn't statically generated for - but Next does not
* share generateStaticParams between a page and its sibling metadata
* routes, so without this export every provider's OG image 404s.
*/
export async function generateStaticParams() {
return MODEL_PROVIDERS_WITH_CATALOGS.map((provider) => ({
provider: provider.slug,
}))
}

export default async function Image({ params }: { params: Promise<{ provider: string }> }) {
const { provider: providerSlug } = await params
const provider = getProviderBySlug(providerSlug)
Expand Down
Loading