fix(notion): 修复菜单跳转 Category Mapping Page 404 - #4344
Merged
tangly1024 merged 1 commit intoJul 31, 2026
Conversation
|
@kforris is attempting to deploy a commit to the tangly1024's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for notionnext-netlify ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
|
这版修复很干净:把菜单来源 slug 和最终页面 href 解耦,避免了 Menu / SubMenu 在 Category Mapping 场景下继续指向旧路径。 测试覆盖也到位,尤其是重复 source slug 的歧义回退,合并后应该能稳定收住这类回归。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
已知问题
启用
POST_URL_PREFIX_MAPPING_CATEGORY后,Page 会在站点数据生成阶段得到带分类与日期前缀的最终路由;但指向该 Page 原始 Slug 的 Menu / SubMenu 仍保留旧路径,因此点击后进入 404。Fixes #4336
解决方案
href,因此会同时继承分类前缀、日期前缀和伪静态.html。改动收益
具体改动
lib/db/SiteDataApi.jslib/db/notion/getCustomMenu.js__tests__/lib/db/SiteDataApi.customMenu.test.js风险与兼容性评估
PublishedPage,且要求原始 Slug 唯一;有歧义时保留菜单原链接。show、target和外链行为不变。测试确认
yarn test __tests__/lib/db/SiteDataApi.customMenu.test.js __tests__/lib/db/notion/getPageProperties.test.js --runInBand(2 suites / 4 tests)yarn test --runInBand(36 suites / 197 tests)yarn type-checkyarn lint(退出码 0;仅有main已存在的 warnings)yarn build(61 个静态页面生成完成)yarn deps:check-lockfilegit diff --check用户文档(
docs/user-guide//docs/developer/)