Skip to content

Redirect to framework overview when switching to missing page#336

Merged
raffaelefarinaro merged 3 commits intomainfrom
feature/framework-selector-404-fallback
Mar 30, 2026
Merged

Redirect to framework overview when switching to missing page#336
raffaelefarinaro merged 3 commits intomainfrom
feature/framework-selector-404-fallback

Conversation

@moritzhartmeier
Copy link
Copy Markdown
Member

Swizzle @theme/NotFound/Content to intercept 404s within /sdks/ paths and redirect to the framework's fallback page instead of showing an error:

  • Linux → /sdks/linux/overview/
  • All other frameworks → /sdks/{framework}/core-concepts/

Handles compound frameworks (net/ios, xamarin/android, etc.) and versioned paths (/7.6.9/, /next/). Guards against redirect loops if the fallback page itself is not found.

The fix targets NotFound/Content (used by DocRoot when no doc route matches) rather than NotFound (the top-level catch-all, which is never reached via client-side navigation).

Swizzle @theme/NotFound/Content to intercept 404s within /sdks/ paths
and redirect to the framework's fallback page instead of showing an error:

- Linux → /sdks/linux/overview/
- All other frameworks → /sdks/{framework}/core-concepts/

Handles compound frameworks (net/ios, xamarin/android, etc.) and
versioned paths (/7.6.9/, /next/). Guards against redirect loops if
the fallback page itself is not found.

The fix targets NotFound/Content (used by DocRoot when no doc route
matches) rather than NotFound (the top-level catch-all, which is never
reached via client-side navigation).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
moritzhartmeier and others added 2 commits March 27, 2026 16:21
Core concepts doesn't exist within framework pages in older versions,
so fall back to add-sdk/ instead for /7.6.9/ and /6.28.8/ paths.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Match any 6.28.x or 7.6.x version rather than specific patch versions,
since core-concepts doesn't exist within framework pages in those older
versioned docs.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@raffaelefarinaro raffaelefarinaro merged commit 670273b into main Mar 30, 2026
1 check passed
@raffaelefarinaro raffaelefarinaro deleted the feature/framework-selector-404-fallback branch March 30, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants