When we move or delete a docs page, we need to add a redirect to docs/config.json in a gravitational/docs submodule to prevent links to the page from 404ing. Let's find an alternative to static redirects to make it easier to implement large-scale information architecture changes. Ideally, if a redirect is missing, the docs site should do something more helpful than 404. For example:
See if there is a page on the docs site with the same leaf URL segment, indicating that we moved the page, and redirect the user there.
Redirect the user to the closest parent path segment to the desired one that has a docs page associated with it. For example, /docs/access-controls/sso/missing/ would redirect to /docs/access-controls/sso/. If there is no available parent path segment, the docs site continues walking the path tree until it hits the root docs path, /docs/.
When we move or delete a docs page, we need to add a redirect to
docs/config.json
in agravitational/docs
submodule to prevent links to the page from 404ing. Let's find an alternative to static redirects to make it easier to implement large-scale information architecture changes. Ideally, if a redirect is missing, the docs site should do something more helpful than 404. For example:/docs/access-controls/sso/missing/
would redirect to/docs/access-controls/sso/
. If there is no available parent path segment, the docs site continues walking the path tree until it hits the root docs path,/docs/
.