Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include sidebar_class_name in category index metadata #10095

Open
1 of 2 tasks
wyoungtarget opened this issue May 2, 2024 · 0 comments
Open
1 of 2 tasks

Include sidebar_class_name in category index metadata #10095

wyoungtarget opened this issue May 2, 2024 · 0 comments
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers

Comments

@wyoungtarget
Copy link

wyoungtarget commented May 2, 2024

Have you read the Contributing Guidelines on issues?

Description

When I am using a folder for asset collection (ref) e.g.

some-doc
├── index.md
├── img1.png
└── img2.png

I want the sidebar_class_name frontmatter to be included in the generated sidebar item -- the same as if I had not used a subfolder for asset collection.

For clarity, I am not asking this be placed in the category metadata, which would apply to all child items of that category.

Has this been requested on Canny?

No

Motivation

I have a docusaurs site that utilizes sidebar_class_name for unique visual treatment (in this case, ADR statuses: draft, proposed, accepted, rejected, deprecated, ...). This works fine, until you have a document you place in a folder. Then sidebar_class_name is not passed. The same problem exists when I tried _category_ .yml or .json with className

I found past issues that reference this same challenge:

--

I debated if this was a bug or feature request, the documentation does state:

If the link is explicitly specified, Docusaurus will not apply any default conventions.

However, "Default Conventions" appears to only apply to how an index page for a category is identified. Not having anything to do with its metadata.

API design

No response

Have you tried building it?

No, primarily as I cannot determine if it's a feature gap or a bug. #6254 gives me the closest lead, but the resolution is not immediately clear to me.

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.
@wyoungtarget wyoungtarget added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant