Skip to content

feat: simplify localized content routes - #7

Merged
aazf merged 3 commits into
mainfrom
bkd/xllx3aeb
Mar 9, 2026
Merged

feat: simplify localized content routes#7
aazf merged 3 commits into
mainfrom
bkd/xllx3aeb

Conversation

@aazf

@aazf aazf commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make English the default no-prefix route and keep Chinese under /zh/*
  • move system pages under /sys/*, rename tag pages to /tags/*, and update localized link generation and SEO tags
  • switch tool relationship metadata from relatedTools to link

Verification

  • bun --filter @bkio/frontend build
  • bun --filter @bkio/api tsc --noEmit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread apps/api/src/app.ts Outdated
Comment on lines +35 to +39
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)}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@aazf
aazf merged commit bbf7cd4 into main Mar 9, 2026
1 check passed
@aazf
aazf deleted the bkd/xllx3aeb branch March 9, 2026 19:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +5 to +9
export const RESERVED_ROOT_SEGMENTS = new Set([
'api',
'zh',
'sys',
'tags',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant