diff --git a/src/server/web/index.ts b/src/server/web/index.ts index a732e7f5b4..30a53a703b 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -168,7 +168,7 @@ router.get('/docs.json', async ctx => { } docs.push({ - path: path.replace(`${dirPath}/`, '').split('.')[0], + path: path.match(new RegExp(`docs\/${lang}\/(.+?)\.md$`))![1], title: markdown.renderer.render(headingTokens, {}, {}), summary: markdown.renderer.render(firstParagrapfTokens, {}, {}), });