fix: modify docs Next Page link
Description
[ What changed? Feel free to be brief. ]
When I was on the "getting-started/install", I found the next page link at the bottom was "getting-started/install".
The same phenomenon occurred in "chat/how-to-use-it", "autocomplete/how-to-use-it", "edit/how-to-use-it", and "actions/how-to-use-it".
It has been modified appropriately.
Checklist
- [x] The base branch of this PR is
dev, rather thanmain - [x] The relevant docs, if any, have been updated or created
Screenshots
[ For visual changes, include screenshots. ]
as-is
to-be
Testing
[ For new or modified features, provide step-by-step testing instructions to validate the intended behavior of the change. ]
@DongjaJ thanks for your attention to detail here! I'm wondering if there's a cleaner way we can solve this. It seems like there is something fundamentally wrong causing it to link to itself, perhaps the page index in the frontmatter?
@sestinj
I think the 'link' attribute was misused inside siderbar.js.
Let's take "getting-started" as an example.
Docusaurus reads sidebar settings and identifies the order and hierarchy between documents. If a category has a link property, the document it points to is considered an index document for that category.
Typically, Docusaurus generates "Next" and "Previous" links in the order listed in the sidebar.
And when you give a link attribute to a category in Docusaurus, it treats the document as if it were a virtual "index.md " of that category.
As a result, Docusaur tries to find the next page of "getting-started/install" on "getting-started/index.md " but points to itself because "getting-started/install" is the current page.
After the link is removed, the "install" page is simply treated as an item in the category. "Next page" will now correctly point to the next item in the sidebar ("getting-started/overview").
Thanks @DongjaJ, the new change looks great to me. Appreciate you taking a second look!