You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
documentationThe issue is related to the documentation of DocusaurusfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Currently navigating to /docs will result in a not found page being shown (unless pages/docs/index exists). I'm proposing that we handle this gracefully by redirecting to the first doc page.
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
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.
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 ?
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.
documentationThe issue is related to the documentation of DocusaurusfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Activity
endiliey commentedon Nov 13, 2019
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
endiliey commentedon Nov 13, 2019
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
lex111 commentedon Nov 13, 2019
LGTM, maybe we should even reflect it in docs.
binarylogic commentedon Nov 14, 2019
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.
binarylogic commentedon Nov 14, 2019
Oh, and as a work around we did the following:
Add a
src/pages/docs.jsfile with the following contents:yangshun commentedon Feb 18, 2020
Maybe there can be a new config option for
docusaurus-plugin-docsto redirect/render a specific page when/<routeBasePath>is accessed. WDYT?binarylogic commentedon Feb 18, 2020
That makes sense. My above work around works well for now. You can also setup a redirect with your host (Netlify).
jamiedavenport commentedon Feb 19, 2020
@yangshun Is there a benefit to having a config option for this over implementing a
src/pages/docs.jspage?What about a combination of documentation and a default
docs.jspage in the template as the solution?aeneasr commentedon Apr 6, 2020
The proposed workaround does not work when using docs only mode. The missing
index.mdfeature also affects subdirectories - see #2537