From 52e72e2c60e77df7ed877308b522e760340b57da Mon Sep 17 00:00:00 2001 From: pseudoyu Date: Wed, 23 Oct 2024 11:43:12 +0800 Subject: [PATCH] fix(docs): handle duplicated routes in docs --- scripts/workflow/build-docs.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/workflow/build-docs.ts b/scripts/workflow/build-docs.ts index c2faf99f9fafd5..8aa2a39f256efe 100644 --- a/scripts/workflow/build-docs.ts +++ b/scripts/workflow/build-docs.ts @@ -96,8 +96,17 @@ function generateMd(lang) { } }); + const processedPaths = new Set(); + for (const realPath of realPaths) { const data = docs[category][namespace].routes[realPath]; + if (Array.isArray(data.path)) { + if (processedPaths.has(data.path[0])) { + continue; + } + processedPaths.add(data.path[0]); + } + const test = testResult.find((t) => t.title === realPath); const parsedTest = test ? {