Repository navigation
fix: use the sidebar base path rule when building info_path - #1651
Merged
Merged
Conversation
The infoPath calculation split outputDir on docPath as a substring, so an output dir such as "docs/test/docspace" produced "docs/test//<infoId>" and broke the API explorer's Authentication link. Share the startsWith helper from #1368 between the sidebar generator and infoPath, and skip empty segments so a docs-root output dir no longer yields "//". Supersedes #1306. Thanks to @trofim24 for the original report and fix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Size Change: 0 B Total Size: 2.45 MB ℹ️ View Unchanged
|
|
Visit the preview URL for this PR (updated for commit 88c5e26): (expires Fri, 16 Oct 2026 18:08:13 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
📸 Visual Diff ReportSnapshot comparison against https://docusaurus-openapi.tryingpan.dev/
✅ No visual regressions detected. Updated at 2026-10-09T18:14:00.436Z · run 37970729843 |
This branch was successfully deployed
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.
Description
The
infoPathcalculation inindex.tsstrippeddocPathfromoutputDirwithoutputDir.split(docPath), which matches a substring instead of a path prefix. #1368 fixed the same bug in the sidebar generator with astartsWithcheck, but the copy inindex.tswas left behind.outputDirdocPathinfo_pathbeforeinfo_pathafterdocs/test/docspacedocsdocs/test//<infoId>docs/test/docspace/<infoId>docs/api/docs-v2docsdocs/api//<infoId>docs/api/docs-v2/<infoId>docsdocsdocs//<infoId>docs/<infoId>docs/petstoredocsdocs/petstore/<infoId>info_pathfeeds the API explorer's Authentication link (SecuritySchemes:/${infoPath}#authentication), so the affected layouts had a broken link.Changes:
getBasePathFromOutputfromsidebars/index.tstosidebars/utils.ts(no logic change), so the sidebar IDs andinfo_pathuse the same rule.getInfoPath()inindex.ts, which joins the route base path, base path, and info ID, and skips empty segments.Supersedes #1306. Thanks to @trofim24 for the original report and fix.
How Has This Been Tested?
sidebars/utils.test.tscoversgetBasePathFromOutput, including the substring cases above.getInfoPathcases inindex.test.tscover the table above, plusrouteBasePathvalues of/andapi/.yarn test: 12 suites, 135 tests pass.yarn lintreports the same 6 errors asmain, all in theme files that this PR does not touch.Types of changes
🤖 Generated with Claude Code