-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[V2] Handle /docs route #1973
Comments
Determining the first “docs page” is very confusing. We allow multiple sidebar or no sidebar at all. How do we know which one is the first doc page ? Do we sort by alphabet ? Or do we sort by first item in sidebar ? If there is sidebar A and sidebar B, which one to choose ? What if user doesnt have a sidebar ? (not all doc site has sidebar) Some people might want their own custom docs page using “src/pages/docs/index.js” as well. With that, you can also create a redirect to the right page. Or if you prefer 301 html redirect, create a docs/index.html in static folder |
Check https://docusaurus.io/ itself There are Docs and Tutorial Section in headerlinks. Both have different sidebars. If i go to /docs, how do we know which one to choose ? More problems go even more when versioning and translation came in. Do we go to /docs/en or /docs/ko or /docs/en/next or /docs/en/1.0.0 ? The best solution is still creating your own “src/pages/docs/index.js” which is very flexible and let user decide |
LGTM, maybe we should even reflect it in docs. |
Re-iterating my comment here: #1941 (comment). I don't know how many people are actually doing this beyond the Docusaurus site. Moreover, it deviates from the URL structure. The navbar is representing top-level categories but the URL structure is not the same. As mentioned in my comment, it would be better to support drop-down items under "Docs". Infima appears to support this. |
Oh, and as a work around we did the following: Add a
|
Maybe there can be a new config option for |
That makes sense. My above work around works well for now. You can also setup a redirect with your host (Netlify). |
@yangshun Is there a benefit to having a config option for this over implementing a What about a combination of documentation and a default |
The proposed workaround does not work when using docs only mode. The missing |
🚀 Feature
Currently navigating to
/docs
will result in a not found page being shown (unlesspages/docs/index
exists). I'm proposing that we handle this gracefully by redirecting to the first doc page.Have you read the Contributing Guidelines on issues?
Yes
Motivation
Showing a not found page isn't very helpful to a user that's likely searching for the documentation.
In most cases, I can imagine the user wanting to be redirected to valid documentation.
Pitch
/docs
instead of a specific page which allows us to change or remove that page without breaking the links.If we agree on a solution, I'd also be happy to implement it and open a PR.
The text was updated successfully, but these errors were encountered: