From 5274efd8f97b7254755b19d6c6fc8c908bcc3662 Mon Sep 17 00:00:00 2001 From: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Date: Wed, 15 Apr 2026 12:13:30 -0700 Subject: [PATCH] improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (#4170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * improvement(seo): optimize sitemaps and robots.txt across sim and docs - Add missing pages to sim sitemap: blog author pages, academy catalog and course pages - Fix 6x duplicate URL bug in docs sitemap by deduplicating with source.getLanguages() - Convert docs sitemap from route handler to Next.js metadata convention with native hreflang - Add x-default hreflang alternate for docs multi-language pages - Remove changeFrequency and priority fields (Google ignores both) - Fix inaccurate lastModified timestamps — derive from real content dates, omit when unknown - Consolidate 20+ redundant per-bot robots rules into single wildcard entry - Add /form/ and /credential-account/ to sim robots disallow list - Reference image sitemap in sim robots.txt - Remove deprecated host directive from sim robots - Move disallow rules before allow in docs robots for crawler compatibility - Extract hardcoded docs baseUrl to env variable with production fallback * fix(seo): remove homepage new Date(), guard latestModelDate empty array * improvement(seo): consolidate DOCS_BASE_URL, optimize core web vitals Extract hardcoded https://docs.sim.ai into shared DOCS_BASE_URL constant in lib/urls.ts and replace all 20+ instances across layouts, metadata, structured data, LLM manifest, sitemap, and robots files. Remove OneDollarStats analytics script and tighten CSP for improved core web vitals. * fix: removed onedollarstats from bun lock * fix(seo): guard per-provider Math.max, consolidate docs robots to single wildcard --- apps/docs/app/[lang]/[[...slug]]/page.tsx | 3 +- apps/docs/app/[lang]/layout.tsx | 9 +- apps/docs/app/layout.tsx | 25 ++-- apps/docs/app/llms.txt/route.ts | 3 +- apps/docs/app/robots.txt/route.ts | 73 +--------- apps/docs/app/sitemap.ts | 42 ++++++ apps/docs/app/sitemap.xml/route.ts | 62 -------- apps/docs/components/structured-data.tsx | 4 +- apps/docs/lib/urls.ts | 1 + apps/sim/app/layout.tsx | 6 - apps/sim/app/robots.ts | 136 ++---------------- apps/sim/app/sitemap.ts | 127 +++++++++------- .../components/analytics/onedollarstats.tsx | 26 ---- apps/sim/lib/core/config/env.ts | 1 - apps/sim/lib/core/security/csp.ts | 3 - apps/sim/package.json | 1 - bun.lock | 3 - 17 files changed, 159 insertions(+), 366 deletions(-) create mode 100644 apps/docs/app/sitemap.ts delete mode 100644 apps/docs/app/sitemap.xml/route.ts create mode 100644 apps/docs/lib/urls.ts delete mode 100644 apps/sim/components/analytics/onedollarstats.tsx diff --git a/apps/docs/app/[lang]/[[...slug]]/page.tsx b/apps/docs/app/[lang]/[[...slug]]/page.tsx index d01cd5d359..8bf0c5fd80 100644 --- a/apps/docs/app/[lang]/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/[[...slug]]/page.tsx @@ -17,9 +17,10 @@ import { ResponseSection } from '@/components/ui/response-section' import { i18n } from '@/lib/i18n' import { getApiSpecContent, openapi } from '@/lib/openapi' import { type PageData, source } from '@/lib/source' +import { DOCS_BASE_URL } from '@/lib/urls' const SUPPORTED_LANGUAGES: Set = new Set(i18n.languages) -const BASE_URL = 'https://docs.sim.ai' +const BASE_URL = DOCS_BASE_URL const OG_LOCALE_MAP: Record = { en: 'en_US', diff --git a/apps/docs/app/[lang]/layout.tsx b/apps/docs/app/[lang]/layout.tsx index c500f440cb..4f32bf2076 100644 --- a/apps/docs/app/[lang]/layout.tsx +++ b/apps/docs/app/[lang]/layout.tsx @@ -3,7 +3,6 @@ import { defineI18nUI } from 'fumadocs-ui/i18n' import { DocsLayout } from 'fumadocs-ui/layouts/docs' import { RootProvider } from 'fumadocs-ui/provider/next' import { Geist_Mono, Inter } from 'next/font/google' -import Script from 'next/script' import { SidebarFolder, SidebarItem, @@ -13,6 +12,7 @@ import { Navbar } from '@/components/navbar/navbar' import { SimLogoFull } from '@/components/ui/sim-logo' import { i18n } from '@/lib/i18n' import { source } from '@/lib/source' +import { DOCS_BASE_URL } from '@/lib/urls' import '../global.css' const inter = Inter({ @@ -67,14 +67,14 @@ export default async function Layout({ children, params }: LayoutProps) { name: 'Sim Documentation', description: 'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.', - url: 'https://docs.sim.ai', + url: DOCS_BASE_URL, publisher: { '@type': 'Organization', name: 'Sim', url: 'https://sim.ai', logo: { '@type': 'ImageObject', - url: 'https://docs.sim.ai/static/logo.png', + url: `${DOCS_BASE_URL}/static/logo.png`, }, }, inLanguage: lang, @@ -82,7 +82,7 @@ export default async function Layout({ children, params }: LayoutProps) { '@type': 'SearchAction', target: { '@type': 'EntryPoint', - urlTemplate: 'https://docs.sim.ai/api/search?q={search_term_string}', + urlTemplate: `${DOCS_BASE_URL}/api/search?q={search_term_string}`, }, 'query-input': 'required name=search_term_string', }, @@ -101,7 +101,6 @@ export default async function Layout({ children, params }: LayoutProps) { /> -