From 09e3183c7886e7c1bd290359937dc9df2b012192 Mon Sep 17 00:00:00 2001 From: Sarah Gerrard <98355961+LadyBluenotes@users.noreply.github.com> Date: Wed, 25 Mar 2026 21:28:42 -0700 Subject: [PATCH] refactor(sitemap): simplify sitemap generation by removing unused route handling and enhancing high-value page entries --- src/utils/seo.ts | 13 ------------- src/utils/sitemap.ts | 2 -- 2 files changed, 15 deletions(-) diff --git a/src/utils/seo.ts b/src/utils/seo.ts index 31b8daef..017649dd 100644 --- a/src/utils/seo.ts +++ b/src/utils/seo.ts @@ -1,6 +1,4 @@ import { env } from '~/utils/env' -import { findLibrary } from '~/libraries' - const DEFAULT_SITE_URL = 'https://tanstack.com' const NON_INDEXABLE_PATH_PREFIXES = ['/account', '/admin', '/login'] as const @@ -30,17 +28,6 @@ export function getCanonicalPath(path: string) { return null } - const pathSegments = normalizedPath.split('/').filter(Boolean) - - if (pathSegments.length >= 2) { - const [libraryId, version, ...rest] = pathSegments - const library = findLibrary(libraryId) - - if (library && version !== 'latest') { - return normalizePath(`/${library.id}/latest/${rest.join('/')}`) - } - } - return normalizedPath } diff --git a/src/utils/sitemap.ts b/src/utils/sitemap.ts index 6fcd145e..c769e117 100644 --- a/src/utils/sitemap.ts +++ b/src/utils/sitemap.ts @@ -175,8 +175,6 @@ export function generateRobotsTxt(origin: string) { return [ 'User-agent: *', 'Allow: /', - 'Disallow: /api/', - 'Disallow: /oauth/', '', `Sitemap: ${origin}/sitemap.xml`, ].join('\n')