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
12 changes: 8 additions & 4 deletions apps/docs/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import { DOCS_BASE_URL } from '@/lib/urls'
export const revalidate = 3600

export default function sitemap(): MetadataRoute.Sitemap {
return source.getPages().map((page) => ({
url: `${DOCS_BASE_URL}${page.url}`,
lastModified: 'lastModified' in page.data ? page.data.lastModified : undefined,
}))
// The docs root redirects to /introduction, which is listed on its own.
return source
.getPages()
.filter((page) => page.url !== '/')
.map((page) => ({
url: `${DOCS_BASE_URL}${page.url}`,
lastModified: 'lastModified' in page.data ? page.data.lastModified : undefined,
}))
}
7 changes: 5 additions & 2 deletions apps/sim/app/(landing)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { getAllPostMeta, getPostBySlug, getRelatedPosts } from '@/lib/blog/regis
import { BLOG_SECTION, buildPostGraphJsonLd, buildPostMetadata } from '@/lib/blog/seo'
import { ContentPostPage } from '@/app/(landing)/components'

/** Unknown slugs reach the section 404 while known pages remain pre-rendered. */
export const dynamicParams = true
/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

export async function generateStaticParams() {
const posts = await getAllPostMeta()
Expand Down
11 changes: 11 additions & 0 deletions apps/sim/app/(landing)/blog/authors/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import { ContentAuthorPage } from '@/app/(landing)/components'

export const revalidate = 3600

/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

export async function generateStaticParams() {
const ids = new Set((await getAllPostMeta()).flatMap((p) => p.authors.map((a) => a.id)))
return [...ids].map((id) => ({ id }))
}

export async function generateMetadata({
params,
}: {
Expand Down
7 changes: 5 additions & 2 deletions apps/sim/app/(landing)/integrations/(shell)/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ const MAX_TEMPLATES_SHOWN = 12
const bySlug = new Map(allIntegrations.map((i) => [i.slug, i]))
const byType = new Map(allIntegrations.map((i) => [i.type, i]))

/** Unknown slugs reach the section 404 while known pages remain pre-rendered. */
export const dynamicParams = true
/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

/**
* Returns up to `limit` related integration slugs from the same category, so
Expand Down
7 changes: 5 additions & 2 deletions apps/sim/app/(landing)/library/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { ComparisonLinks } from '@/app/(landing)/comparisons/components/comparis
import { getComparisonsForPost } from '@/app/(landing)/comparisons/library-links'
import { ContentPostPage } from '@/app/(landing)/components'

/** Unknown slugs reach the section 404 while known pages remain pre-rendered. */
export const dynamicParams = true
/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

export async function generateStaticParams() {
const posts = await getAllPostMeta()
Expand Down
11 changes: 11 additions & 0 deletions apps/sim/app/(landing)/library/authors/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import { ContentAuthorPage } from '@/app/(landing)/components'

export const revalidate = 3600

/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

export async function generateStaticParams() {
const ids = new Set((await getAllPostMeta()).flatMap((p) => p.authors.map((a) => a.id)))
return [...ids].map((id) => ({ id }))
}

export async function generateMetadata({
params,
}: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { LANDING_CONTENT_WIDTH, LANDING_GUTTER } from '@/app/(landing)/component
import { ShareButton } from '@/app/(landing)/components/share-button'
import { FeaturedModelCard, ProviderIcon } from '@/app/(landing)/models/components/model-primitives'
import {
ALL_CATALOG_MODELS,
buildModelCapabilityFacts,
buildModelFaqs,
formatPrice,
Expand All @@ -21,18 +20,21 @@ import {
getPricingBounds,
getProviderBySlug,
getRelatedModels,
MODEL_PROVIDERS_WITH_MODELS,
} from '@/app/(landing)/models/utils'

const baseUrl = SITE_URL

/** Unknown slugs reach the section 404 while known pages remain pre-rendered. */
export const dynamicParams = true
/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false

export async function generateStaticParams() {
return ALL_CATALOG_MODELS.map((model) => ({
provider: model.providerSlug,
model: model.slug,
}))
return MODEL_PROVIDERS_WITH_MODELS.flatMap((provider) =>
provider.models.map((model) => ({ provider: provider.slug, model: model.slug }))
)
}

export async function generateMetadata({
Expand Down
10 changes: 7 additions & 3 deletions apps/sim/app/(landing)/models/(shell)/[provider]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ import {
formatTokenCount,
getProviderBySlug,
MODEL_PROVIDERS_WITH_CATALOGS,
MODEL_PROVIDERS_WITH_MODELS,
TOP_MODEL_PROVIDERS,
} from '@/app/(landing)/models/utils'

const baseUrl = SITE_URL

/** Unknown slugs reach the section 404 while known pages remain pre-rendered. */
export const dynamicParams = true
/**
* Unknown params must 404 before rendering: `notFound()` during render streams this segment's
* `loading.tsx` with a 200 status first.
*/
export const dynamicParams = false
Comment thread
waleedlatif1 marked this conversation as resolved.

export async function generateStaticParams() {
return MODEL_PROVIDERS_WITH_CATALOGS.map((provider) => ({
return MODEL_PROVIDERS_WITH_MODELS.map((provider) => ({
provider: provider.slug,
}))
}
Expand Down
4 changes: 4 additions & 0 deletions apps/sim/app/(landing)/models/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ function assertUniqueGeneratedRoutes(providers: CatalogProvider[]): void {
assertUniqueGeneratedRoutes(rawProviders)

export const MODEL_CATALOG_PROVIDERS: CatalogProvider[] = rawProviders
/** Every provider with a page: those with a model catalog, resellers included. */
export const MODEL_PROVIDERS_WITH_MODELS = MODEL_CATALOG_PROVIDERS.filter(
(provider) => provider.models.length > 0
)
export const MODEL_PROVIDERS_WITH_CATALOGS = MODEL_CATALOG_PROVIDERS.filter(
(provider) => provider.models.length > 0 && !provider.isReseller
)
Expand Down
Loading