[V2] Handle /docs route
See original GitHub issue🚀 Feature
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.
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
- Better UX for the end-user.
- Can link to
/docsinstead of a specific page which allows us to change or remove that page without breaking the links. - Looking at the existing V2 showcase, they all link to the first page of docs anyway.
If we agree on a solution, I’d also be happy to implement it and open a PR.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (8 by maintainers)
Top Results From Across the Web
bookmark_border - Google Cloud
Routes API v2 - Package cloud.google.com/go/maps/routing/apiv2 (v0.1.0) ... (at https://cloud.google.com/apis/docs/system-parameters).
Read more >handle (Caddyfile directive) — Caddy Documentation
Evaluates a group of directives mutually exclusively from other handle ... 1) route blocks are not mutually exclusive to each other, and 2)...
Read more >Routers - Traefik Labs documentation
In Traefik Proxy, a router is in charge of connecting incoming requests to the Services that can handle them. Read the technical documentation....
Read more >HTTP route components (proto) - Envoy Proxy
Internally, Envoy always uses the HTTP/2 :authority header to represent the ... Stripping a prefix from a path requires multiple Routes to handle...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Oh, and as a work around we did the following:
Add a
src/pages/docs.jsfile with the following contents: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