-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Autogenerated entries: allow image override per entry #7844
Comments
By "image", you mean the "icon"? You can already do so by swizzling and passing the source through |
that's what i meant. yes. Ok brilliant, i'll take a look at this, thanks Josh. |
Just saying "swizzle" it doesn't give enough information how to actually do so. Without adding any API changes, it would still be helpful to put some actual code examples in the docs how to achieve custom Link icons on autogenerated category cards. |
For everyone coming here. The component you have to swizzle is the DocCard component. I recommend to swizzle it with --eject in order to not modify too much of the original component. That way in case of potential breaking changes (upcoming v3) the diff and migration effort is hopefully rather small and you can compare newer versions to your old code. Command used: |
Hope that this can be revisted with proper official way rather than having a workaround/hack that leads to this:
|
@undergroundwires this is not a workaround/hack, this is the official way You can override whatever we provide, we just want to warn you that we might have to refactor things and you'd need to adjust your code accordingly. Unsafe might feel a bit too scary but it's perfectly fine to eject it |
For anyone interested, I explained how to do this here: #10476 (comment) |
Have you read the Contributing Guidelines on issues?
Description
In the current state, Docusaurus' autogenerated entries generates tiles looking like this:
Auto-generating entries is a great feature, and in my case, I'd like to use it to get scalable docs, such as listing many partners that my company integrates with.
For this, I would suggest to add the ability to customize the image that we add to the tile. Currently it's either the file or folder icon.
For example, adding this to the sidebar to specify a new image:
Or when generating tiles from a doc page with:
We could perhaps define the image in each entry in the
sidebar.js
file as well, using longhand notation:Has this been requested on Canny?
No response
Motivation
I need this feature for scalability reasons so this feature will happen either on my own repo, but it should ideally be a core feature as it might help other users. I can possibly get a developer to submit a PR to your repo if you can share some pointers on how to do this 'the right way'.
API design
No response
Have you tried building it?
No response
Self-service
The text was updated successfully, but these errors were encountered: