feat(content-docs): custom category/link descriptions in generated index page
Pre-flight checklist
- [x] I have read the Contributing Guidelines on pull requests.
- [x] If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
- [ ] If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.
Motivation
For all the discussion made, look for issue #7818
Test Plan
In order to test this problem, I needed to display a link with description, here you can find a screenshot on how it would be a correct behaviour

Test links
Deploy preview: https://deploy-preview-8236--docusaurus-2.netlify.app/
Related issues/PRs
This PR resolves issue #7818
[V2]
| Name | Link |
|---|---|
| Latest commit | d4b1431846055bd0bef7e084100d80122331ac54 |
| Latest deploy log | https://app.netlify.com/sites/docusaurus-2/deploys/6412142657ec7b0008919f4d |
| Deploy Preview | https://deploy-preview-8236--docusaurus-2.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
⚡️ Lighthouse report for the deploy preview of this PR
| URL | Performance | Accessibility | Best Practices | SEO | PWA | Report |
|---|---|---|---|---|---|---|
| / | 🟠 79 | 🟢 97 | 🟢 100 | 🟢 100 | 🟢 90 | Report |
| /docs/installation | 🟠 72 | 🟢 100 | 🟢 100 | 🟢 100 | 🟢 90 | Report |
Hi @ZarakiKanzaki!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
@slorber I tried to follow all guidelines for the repo, It's my first PR and I just want to be sure I made everything alright 😊
#7818 also asks for category descriptions. Could you add that as well?
Sure! I'll work on that asap, probably this evening 😊 I'm really enjoying dealing with this project
Great to know! Good luck ;)
#7818 also asks for category descriptions. Could you add that as well?
I updated the PR, if you need any kind of image I'll post them here :)
Thanks! Code looks fine to me at a glance. Could you test localization? (Probably have to be manual)
So do I have to write the content of the card with my native language, don't I?
Hey
The original issue asks for more than this PR implement.
We also need tests and docs.
If you don't have time or are not confident working on all the issue features, we can also split it into multiple smaller PRs and only implement support for link description in this one (for which what you added is good enough)
If you need help, let me know.
Hey @slorber! thanks for the feedback, I believe I can easily fix what you asked in next days. I don't know if I'm able to complete every features asked in the original issue. The reason is more related with the fact I had to do some 'reverse engineering' to understand how the solution works. If you agree I would opt for smaller PRs as you were suggesting. What do think? 😊
doing reverse engineering is always part of the job. I don't always remember of how my own code works 😅
Yes you can just implement the link description and we'll figure out the rest in other PRs
@slorber I still need to create the section about the documentation, should it be created inside the test page, or inside the real doc?
Question, where are we at with this? Is it still coming, or do we need someone to jump in here?
Hey @slorber you mentioned "Did some minor edits and added basic docs." -- where are these basic docs? Can't find them anywhere, and would love to use this new feature
The docs is: https://github.com/facebook/docusaurus/pull/8236/commits/d4b1431846055bd0bef7e084100d80122331ac54 and yes, it's basically one line in the typedef.
thanks @Josh-Cena! would you or any other dev be able to provide a quick example on how to set a custom emoji (instead of the default "blank page" one) for the index of a sidebar item? we're using an auto-generated index, so guessing we'll need to override something for this particular sidebar item?
You can't change the icon of a page through config. You have to swizzle DocCard and provide your own icon implementation.
I see - is the DocCard swizzling covered anywhere in the Docusaurus docs?
we have generic docs for swizzling in general