question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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 /docs instead 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
binarylogiccommented, Nov 14, 2019

Oh, and as a work around we did the following:

Add a src/pages/docs.js file with the following contents:

import React from 'react';
import {Redirect} from '@docusaurus/router';
function Docs() {
  return <Redirect to="/docs/my-doc" />;
}
export default Docs;
2reactions
endilieycommented, 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

Read more comments on GitHub >

github_iconTop 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 >
Routes - Fastify
Fast and low overhead web framework, for Node.js.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found