Skip to content

Commit db4647c

Browse files
committed
fix(seo): use canonical SITE_URL for robots and sitemap
1 parent 4295a5c commit db4647c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

apps/sim/app/robots.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { MetadataRoute } from 'next'
2-
import { getBaseUrl } from '@/lib/core/utils/urls'
2+
import { SITE_URL } from '@/lib/core/utils/urls'
33

44
const DISALLOWED_PATHS = [
55
'/api/',
@@ -45,8 +45,6 @@ const LINK_PREVIEW_BOTS = [
4545
]
4646

4747
export default function robots(): MetadataRoute.Robots {
48-
const baseUrl = getBaseUrl()
49-
5048
return {
5149
rules: [
5250
{ userAgent: '*', allow: '/', disallow: DISALLOWED_PATHS },
@@ -56,6 +54,6 @@ export default function robots(): MetadataRoute.Robots {
5654
disallow: LINK_PREVIEW_DISALLOWED_PATHS,
5755
},
5856
],
59-
sitemap: [`${baseUrl}/sitemap.xml`, `${baseUrl}/blog/sitemap-images.xml`],
57+
sitemap: [`${SITE_URL}/sitemap.xml`, `${SITE_URL}/blog/sitemap-images.xml`],
6058
}
6159
}

apps/sim/app/sitemap.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { MetadataRoute } from 'next'
22
import { COURSES } from '@/lib/academy/content'
33
import { getAllPostMeta } from '@/lib/blog/registry'
4-
import { getBaseUrl } from '@/lib/core/utils/urls'
4+
import { SITE_URL } from '@/lib/core/utils/urls'
55
import integrations from '@/app/(landing)/integrations/data/integrations.json'
66
import { ALL_CATALOG_MODELS, MODEL_PROVIDERS_WITH_CATALOGS } from '@/app/(landing)/models/utils'
77

88
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
9-
const baseUrl = getBaseUrl()
9+
const baseUrl = SITE_URL
1010
const posts = await getAllPostMeta()
1111

1212
const latestPostDate =
@@ -46,6 +46,12 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
4646
{
4747
url: `${baseUrl}/partners`,
4848
},
49+
{
50+
url: `${baseUrl}/contact`,
51+
},
52+
{
53+
url: `${baseUrl}/templates`,
54+
},
4955
{
5056
url: `${baseUrl}/terms`,
5157
lastModified: new Date('2024-10-14'),

0 commit comments

Comments
 (0)