Skip to content

Conversation

longsizhuo
Copy link
Member

Summary

  • reorganize app under app/[locale] for locale-specific routing
  • generate static params for each locale and adjust search path
  • update docs path and image scripts for new layout

Testing

  • pnpm migrate:images
  • pnpm lint:images
  • pnpm build

https://chatgpt.com/codex/tasks/task_e_68c703806430832398e75bf880b22fea

Copy link

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

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 suggestions.

Reply with @codex fix comments to fix any unresolved comments.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment on lines 1 to +4
import { defineDocs, defineConfig } from "fumadocs-mdx/config";

export const docs = defineDocs({
dir: "app/docs",
dir: "app/[locale]/docs",

Choose a reason for hiding this comment

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

[P1] Update docs baseUrl to include locale prefix

Renaming the docs tree to app/[locale]/docs means every docs page now lives under a locale segment, but the Fumadocs loader still uses baseUrl: "/docs" in lib/source.ts. Components like DocsLayout and the search index build URLs by concatenating this base URL, so links and search results will continue to point at /docs/... while the actual routes are /en/docs/..., /zh/docs/..., etc. Navigation for all non-default paths will 404 after this commit. The base URL should be made locale-aware (e.g. prefixed with the current locale) alongside this directory move.

Useful? React with 👍 / 👎.

@Crokily
Copy link
Contributor

Crokily commented Sep 15, 2025

测试过程:
pnpm migrate:images
pnpm lint:images
pnpm build

测试静态站点:pnpm dlx serve out -l 3000
访问后效果如下图:
image
点zh后进入中文首页,点中文首页的访问知识库按钮后会404
image
所有路径要手动加zh才能使用,如:http://localhost:3000/docs/ai -> http://localhost:3000/zh/docs/ai 否则都是404,因此目前导航也无法使用

测试动态站点:pnpm dev 也有同样问题 并且首页直接404

@longsizhuo longsizhuo changed the title feat: add locale-aware routing Draft: add locale-aware routing Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants