Skip to content

Commit 0cac304

Browse files
sserrataclaude
andcommitted
fix(plugin): restore menu__list-item--deprecated class on sidebar items
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 <noreply@anthropic.com>
1 parent f68cf21 commit 0cac304

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

demo/templates/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ hide_table_of_contents: true
1919
api: {{{json}}}
2020
{{/json}}
2121
{{#api.method}}
22-
sidebar_class_name: "{{{api.method}}} api-method"
22+
sidebar_class_name: "{{{api.method}}} api-method{{#api.deprecated}} menu__list-item--deprecated{{/api.deprecated}}"
2323
{{/api.method}}
2424
{{#infoPath}}
2525
info_path: {{{infoPath}}}

packages/docusaurus-plugin-openapi-docs/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ hide_table_of_contents: true
223223
api: {{{json}}}
224224
{{/json}}
225225
{{#api.method}}
226-
sidebar_class_name: "{{{api.method}}} api-method"
226+
sidebar_class_name: "{{{api.method}}} api-method{{#api.deprecated}} menu__list-item--deprecated{{/api.deprecated}}"
227227
{{/api.method}}
228228
{{#infoPath}}
229229
info_path: {{{infoPath}}}

0 commit comments

Comments
 (0)