Skip to content

Comments

Implement dynamic category landing page redirect#10

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/complete-and-close-repository
Draft

Implement dynamic category landing page redirect#10
Copilot wants to merge 3 commits intomainfrom
copilot/complete-and-close-repository

Conversation

Copy link

Copilot AI commented Feb 20, 2026

Navigating to a category URL (e.g. /docs/en/get-started) previously returned a 404. Now it redirects (302) to the first document in that category per the TOC.

Changes

  • src/http/get-docs-000lang-catchall/index.mjs

    • Added getFirstLeaf(): traverses TOC structure to find the first document URL in a branch
    • Added findFirstDocPath(): maps URL path segments to TOC categories, returns first doc URL
    • Catch block: on ENOENT, attempt category redirect before falling through to 404
    • Passes lang from request context into path prefix (avoids hardcoded /docs/en)
  • test/backend/sandbox-http-test.mjs: Adds redirect status + location header assertions for a category path

  • readme.md: Marks dynamic category landing page and a homepage Todo items complete; updates stale dev note

Behavior

URL Before After
/docs/en/get-started 404 302 → /docs/en/get-started/why-architect
/docs/en/guides 404 302 → /docs/en/guides/developer-experience/local-development
/docs/en/about 404 302 → /docs/en/about/mission
Unknown path 404 404 (unchanged)

Thank you for helping out! ✨

We really appreciate your commitment to improving Architect

To maintain a high standard of quality in our releases, before merging every pull request we ask that you've completed the following:

  • Forked the repo and created your branch from main
  • Made sure tests pass (run npm it from the repo root)
  • Updated relevant documentation internal to this repo (e.g. readme.md, help docs, inline docs & comments, etc.)
  • Linked to any related issues, PRs, etc. below that may relate to, consume, or necessitate these changes

Please also be sure to completed the CLA as it's required for your PR to be merged. A github comment will prompt you if you haven't already.

Learn more about contributing to Architect here.

Thanks again!


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 20, 2026 06:27
Co-authored-by: grealalexander2-collab <228605079+grealalexander2-collab@users.noreply.github.com>
Co-authored-by: grealalexander2-collab <228605079+grealalexander2-collab@users.noreply.github.com>
Copilot AI changed the title [WIP] Complete and close the repository Implement dynamic category landing page redirect Feb 20, 2026
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