Skip to content

Commit 272a11c

Browse files
fixes broken integration links (#627)
Co-authored-by: Rachel Lee Nabors <nearestnabors@users.noreply.github.com>
1 parent c7a8c53 commit 272a11c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

app/en/resources/integrations/components/toolkits.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ import { ToolCard } from "./tool-card";
1414
import { TYPE_CONFIG, TYPE_DESCRIPTIONS } from "./type-config";
1515
import { useFilterStore, useToolkitFilters } from "./use-toolkit-filters";
1616

17+
// Map old MCP server paths to new integration paths
18+
function mapToNewIA(oldLink: string): string {
19+
// Pattern: /en/mcp-servers/{category}/{tool} -> /en/resources/integrations/{category}/{tool}/reference
20+
const mcpServerPattern = /^\/en\/mcp-servers\/([^/]+)\/([^/]+)$/;
21+
const match = oldLink.match(mcpServerPattern);
22+
23+
if (match) {
24+
const [, category, tool] = match;
25+
return `/en/resources/integrations/${category}/${tool}/reference`;
26+
}
27+
28+
// Return original link if it doesn't match the pattern
29+
return oldLink;
30+
}
31+
1732
export default function Toolkits() {
1833
const clearAllFilters = useFilterStore((state) => state.clearAllFilters);
1934

@@ -123,7 +138,7 @@ export default function Toolkits() {
123138
isComingSoon={toolkit.isComingSoon}
124139
isPro={toolkit.isPro}
125140
key={toolkit.id}
126-
link={toolkit.relativeDocsLink}
141+
link={mapToNewIA(toolkit.relativeDocsLink)}
127142
name={toolkit.label}
128143
type={toolkit.type}
129144
/>

0 commit comments

Comments
 (0)