From 7705a7928e1ea952b7185162844576575c1a4bab Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Aug 2021 20:39:27 +0900 Subject: [PATCH] fix bug that docs not loading --- src/server/web/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, {}, {}), });