Skip to content

Commit 7d60d5e

Browse files
committed
fix(seo): replace hardcoded URLs with SITE_URL, broaden test detection
- Replace hardcoded https://www.sim.ai with SITE_URL in academy, changelog.xml, and whitelabeling - Broaden getBaseUrl() detection in SEO test to match any variable name assignment - Add ee/whitelabeling/metadata.ts to SEO test scan scope
1 parent 67a91e4 commit 7d60d5e

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

apps/sim/app/(landing)/seo.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const SEO_SCAN_DIRS = [
2424
path.resolve(SIM_ROOT, 'content', 'blog'),
2525
]
2626

27-
const SEO_SCAN_INDIVIDUAL_FILES = [path.resolve(APP_DIR, 'page.tsx')]
27+
const SEO_SCAN_INDIVIDUAL_FILES = [
28+
path.resolve(APP_DIR, 'page.tsx'),
29+
path.resolve(SIM_ROOT, 'ee', 'whitelabeling', 'metadata.ts'),
30+
]
2831

2932
function collectFiles(dir: string, exts: string[]): string[] {
3033
const results: string[] = []
@@ -108,8 +111,7 @@ describe('SEO canonical URLs', () => {
108111
content.includes('export async function generateMetadata')
109112
const usesGetBaseUrlInMetadata =
110113
hasMetadataExport &&
111-
(content.includes('const baseUrl = getBaseUrl()') ||
112-
content.includes('metadataBase: new URL(getBaseUrl'))
114+
(content.includes('= getBaseUrl()') || content.includes('metadataBase: new URL(getBaseUrl'))
113115

114116
if (usesGetBaseUrlInMetadata) {
115117
const rel = path.relative(SIM_ROOT, file)

apps/sim/app/academy/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type React from 'react'
22
import type { Metadata } from 'next'
33
import { notFound } from 'next/navigation'
4+
import { SITE_URL } from '@/lib/core/utils/urls'
45

56
// TODO: Remove notFound() call to make academy pages public once content is ready
67
const ACADEMY_ENABLED = false
@@ -12,7 +13,7 @@ export const metadata: Metadata = {
1213
},
1314
description:
1415
'Become a certified Sim partner — learn to build, integrate, and deploy AI workflows.',
15-
metadataBase: new URL('https://www.sim.ai'),
16+
metadataBase: new URL(SITE_URL),
1617
openGraph: {
1718
title: 'Sim Academy',
1819
description: 'Become a certified Sim partner.',

apps/sim/app/changelog.xml/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { NextResponse } from 'next/server'
2+
import { SITE_URL } from '@/lib/core/utils/urls'
23

34
export const dynamic = 'force-static'
45
export const revalidate = 3600
@@ -48,7 +49,7 @@ export async function GET() {
4849
<rss version="2.0">
4950
<channel>
5051
<title>Sim Changelog</title>
51-
<link>https://www.sim.ai/changelog</link>
52+
<link>${SITE_URL}/changelog</link>
5253
<description>Latest changes, fixes and updates in Sim.</description>
5354
<language>en-us</language>
5455
${items}

apps/sim/ee/whitelabeling/metadata.ts

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

55
/**
@@ -150,7 +150,7 @@ export function generateStructuredData() {
150150
creator: {
151151
'@type': 'Organization',
152152
name: 'Sim',
153-
url: 'https://www.sim.ai',
153+
url: SITE_URL,
154154
},
155155
featureList: [
156156
'AI Workspace for Teams',

0 commit comments

Comments
 (0)