chore: cherry-pick changelog route fix from PR #56038 to 5.x-stable docs (#56138)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 𝑾𝒖𝒙𝒉 <wxh1220@gmail.com>
This commit is contained in:
Copilot
2025-12-10 13:20:49 +08:00
committed by GitHub
parent 2e771318d0
commit 6339b669e7

View File

@@ -157,21 +157,11 @@ const RoutesPlugin = async (api: IApi) => {
api.modifyRoutes((routes) => {
// TODO: append extra routes, such as home, changelog, form-v3
/**
* **important!** Make sure that the `id` and `path` are consistent.
* see: https://github.com/ant-design/ant-design/issues/55960
*/
const extraRoutesList: IRoute[] = [
{
id: 'changelog-cn',
path: 'changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'components-changelog-cn',
path: 'components/changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'changelog',
path: 'changelog',
@@ -180,12 +170,26 @@ const RoutesPlugin = async (api: IApi) => {
file: resolve('../../CHANGELOG.en-US.md'),
},
{
id: 'components-changelog',
id: 'changelog-cn',
path: 'changelog-cn',
absPath: '/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
{
id: 'components/changelog',
path: 'components/changelog',
absPath: '/changelog',
absPath: '/components/changelog',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.en-US.md'),
},
{
id: 'components/changelog-cn',
path: 'components/changelog-cn',
absPath: '/components/changelog-cn',
parentId: 'DocLayout',
file: resolve('../../CHANGELOG.zh-CN.md'),
},
];
extraRoutesList.forEach((itemRoute) => {