Repository navigation
fix(plugin): restore menu__list-item--deprecated class on sidebar items - #1474
Merged
Merged
Conversation
The MDX front matter template emitted `sidebar_class_name` without the deprecated modifier. Under Docusaurus 3.10+ (bundled with v5.0.0), front matter takes precedence over sidebar item className, clobbering the deprecated class set by the sidebar generator. Conditionally append the class in the template so it survives the precedence change. Closes #1417 Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Size Change: 0 B Total Size: 2.32 MB ℹ️ View Unchanged
|
|
Visit the preview URL for this PR (updated for commit 0cac304): (expires Tue, 26 May 2026 14:10:48 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bf293780ee827f578864d92193b8c2866acd459f |
This branch was previously 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.
Summary
menu__list-item--deprecatedto the MDX front matter'ssidebar_class_nametemplate when an operation isdeprecated: trueWhy
The sidebar generator (
packages/docusaurus-plugin-openapi-docs/src/sidebars/index.ts:55) already attachesmenu__list-item--deprecatedto deprecated items viaclsx. That continues to work — but starting with@docusaurus/[email protected](bundled into v5.0.0), Docusaurus changed sidebar-item resolution from:to:
Our MDX template emitted only
"{{{api.method}}} api-method"forsidebar_class_name, so the front matter value clobbered the sidebar generator's className and the deprecated class never reached the DOM. The same edit is applied to the demo's custom mustache template that drives the petstore config.Test plan
petstore,petstore31, andtestsAPI docs and verify front matter:sidebar_class_name: "get api-method menu__list-item--deprecated"sidebar_class_name: "get api-method"(unchanged)<li>carriesmenu__list-item--deprecatedin the built sidebar JSON/petstore31/find-pets-by-tagsCloses #1417
🤖 Generated with Claude Code