feat: simplify localized content routes - #7
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9eef3bd681
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (path === '/privacy') return `${prefix}/sys/privacy` | ||
| if (path === '/terms') return `${prefix}/sys/terms` | ||
| if (path === '/submit') return `${prefix}/sys/submit` | ||
| if (path === '/tag') return `${prefix}/tags` | ||
| if (path.startsWith('/tag/')) return `${prefix}/tags/${path.slice('/tag/'.length)}` |
There was a problem hiding this comment.
Normalize legacy paths before redirect matching
buildRedirectPath only matches exact strings like /privacy, /terms, /submit, and /tag, so legacy URLs with a trailing slash (for example /zh/privacy/ or /en/privacy/) miss these rules. In those cases the handler either skips redirecting entirely (/zh/...) or redirects to another stale path (/en/privacy/ → /privacy/), which then 404s because the new routes live under /sys/* and /tags/*; trimming trailing slashes before the comparisons would preserve backward compatibility for these common URL variants.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5be4c09358
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export const RESERVED_ROOT_SEGMENTS = new Set([ | ||
| 'api', | ||
| 'zh', | ||
| 'sys', | ||
| 'tags', |
There was a problem hiding this comment.
Reserve
en root segment for tool slugs
The new root catch-all route allows English tool pages at /<slug>, but RESERVED_ROOT_SEGMENTS does not include en, so a tool with slug en would be generated under /en while buildRedirectPath in apps/api/src/app.ts now permanently redirects every /en and /en/* request to no-prefix paths. In that case the tool page (and its doc subpaths) become unreachable in production, so en should be treated as reserved (or rejected during content validation) alongside other reserved roots.
Useful? React with 👍 / 👎.
Summary
/zh/*/sys/*, rename tag pages to/tags/*, and update localized link generation and SEO tagsrelatedToolstolinkVerification