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

Allow custom props through _category_.json #6690

Closed
2 tasks done
qiaofeng1227 opened this issue Feb 16, 2022 · 3 comments · Fixed by #6780
Closed
2 tasks done

Allow custom props through _category_.json #6690

qiaofeng1227 opened this issue Feb 16, 2022 · 3 comments · Fixed by #6780
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.

Comments

@qiaofeng1227
Copy link

qiaofeng1227 commented Feb 16, 2022

Have you read the Contributing Guidelines on issues?

We used it docusaurus for our documentation. It's excellent.
I want to customizae generated-index catalog, e.g. show filenames link of directory.
Is there a scheme that can be realized only by setting category.json?

Description

image

image

Has this been requested on Canny?

No response

Motivation

dd

API design

No response

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.
@qiaofeng1227 qiaofeng1227 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 Feb 16, 2022
@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Feb 16, 2022
@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Feb 16, 2022

Hi, you can swizzle DocCard and use the category item's customProps to pass in your own description. However, I do realize that the sidebar generator currently doesn't pass the customProps attribute from the _category_.json, although it now does for sidebar_custom_props after #6619, so it would be a useful extension.

Also requested on Canny: https://docusaurus.canny.io/feature-requests/p/allow-customizing-category-description-in-generated-index-cards I don't think offering an additional API is worth the effort, as DocCard is meant to be swizzled anyways.

@Josh-Cena Josh-Cena changed the title I want to displays the names of all documents, not the quantity on generated-index catalog Allow custom props through _category_.json Feb 16, 2022
@Josh-Cena Josh-Cena added difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. labels Feb 16, 2022
@slorber
Copy link
Collaborator

slorber commented Feb 16, 2022

@Josh-Cena if you have any customization idea for our own site (even just aesthetic ones), I think it can be useful to dogfood this on our own site, add some category customProps and swizzle the cards.

This can be used as an official example for others to look at

@taejs
Copy link
Contributor

taejs commented Feb 27, 2022

I'd like to look into this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: starter Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants