fix(docs): redirect /docs to the introduction page (#338)

/docs returned 404 while every page beneath it resolved and every legacy
URL form already redirected into /docs/*. docsSlugs() only yields nested
slugs, so the /docs segment itself had neither a route nor a generated
redirect, and /docs/ compounded it by 308ing into that dead end.

/docs is the parent of every documentation link on the site and the
likeliest hand-typed entry point, so open it on the Introduction. The
.md sibling keeps the Markdown surface whole for agents that reach for
it, matching the pairing legacyDocsRedirects applies to every slug.

Fixes #331

Co-authored-by: Cris <cristian.correa.cs@gmail.com>
This commit is contained in:
Railly Hugo
2026-08-13 01:20:52 -03:00
committed by GitHub
parent c71a7b4638
commit 7d67158444
+7
View File
@@ -58,6 +58,13 @@ const nextConfig = {
return [
// The Philosophy page became the Introduction, the opening page of the docs.
{ source: "/philosophy", destination: "/docs/introduction", permanent: true },
// docsSlugs() only yields nested slugs, so the /docs segment itself has
// neither a route nor a generated redirect and 404s. It is the parent of
// every documentation link on the site and the likeliest hand-typed entry
// point, so open it on the Introduction instead. The .md sibling keeps the
// Markdown surface whole for agents that reach for it.
{ source: "/docs", destination: "/docs/introduction", permanent: true },
{ source: "/docs.md", destination: "/docs/introduction.md", permanent: true },
...legacyDocsRedirects,
];
},