Skip to content
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

Implement redirects from old docs pages #13

Closed
3 of 5 tasks
jameshadfield opened this issue Sep 24, 2020 · 2 comments
Closed
3 of 5 tasks

Implement redirects from old docs pages #13

jameshadfield opened this issue Sep 24, 2020 · 2 comments

Comments

@jameshadfield
Copy link
Member

jameshadfield commented Sep 24, 2020

Once docs.nextstrain.org is "live" -- as in, all the documentation from augur, auspice, nextstrain.org is being rendered via docs.nextstrain.org (including sub-projects) we need to implement redidirects from the previous location of the documentation

This implementation isn't part of this repo, but this issue is created here as a reminder for us

  • gatsby / nextstrain.org
  • auspice (docusaurus)
  • augur (RTD) - we may want to keep previous versions there?
  • ncov (github pages)
  • cli (RTD)
@eharkins
Copy link
Contributor

eharkins commented Nov 9, 2020

What I have learned about RTD redirects that is not on https://docs.readthedocs.io/en/stable/user-defined-redirects.html (this document left me not totally clear on a lot of things about the different kinds of redirects possible with RTD):

  • you can't redirect from a page that exists. redirects only work if the page you are redirecting from currently is a 404.
  • Page redirects: if you want to redirect a current 404 page on ALL versions (also likely true for languages but I haven't tested this), you should create a page redirect like this:
Page Redirect
/faq/translate_ref.html -> https://docs.nextstrain.org/en/latest/augur/docs/faq/translate_ref.html

It should not include a version or language in the from url. The to url here is another domain, which works as it says in the rtd docs. I haven't tested "internal" redirects as much, i.e. redirecting to a path within the domain like

Page Redirect
/faq/translate_ref.html -> /faq/translate.html

But I imagine it would apply across versions in a similar way and maintain whichever language and version you were redirected from, although it's possible it just sends you to the default version like /en/latest.
In the case of a subproject like augur, the above type of page redirect will also work to redirect from urls using both nextstrain-augur.readthedocs.io urls AND docs.nextstrain.org/projects/augur (which is the auto-created domain for this project as a registered subproject of docs.nextstrain.org).

  • Exact redirects: if you want to redirect a current 404 page on a specific version, you should create an exact redirect like this:
Exact Redirect
/en/migrate-docs/faq/translate_ref.html -> https://docs.nextstrain.org/en/latest/augur/docs/faq/translate_ref.html

The notable differences from the above page redirect example are:

  1. Since it is an exact redirect, it only applies to this version and language
  2. It ONLY works on the default domain, i.e. https://nextstrain-augur.readthedocs.io/en/migrate-docs/faq/translate_ref.html but NOT on the subproject domain version, i.e. https://docs.nextstrain.org/projects/augur/en/migrate-docs/faq/translate_ref.html
    Similar to my testing with the page redirects, I only tested this with redirecting out to another domain. I would guess that unlike page redirects, if you wanted to redirect within the project's domain you would need to specify the to url's language and version since it is an exact redirect, and my general experience with exact redirects is that they will not auto-complete or auto-apply to versions, since the path you specify is interpreted more literally.

@eharkins
Copy link
Contributor

gatsby / nextstrain.org
auspice (docusaurus)
augur (RTD) - we may want to keep previous versions there?

Redirects for these projects' ^ pages are in place.

ncov (github pages)

https://nextstrain.github.io/ncov/ is still up, I believe we decided not to redirect that to https://docs.nextstrain.org/en/latest/tutorials/SARS-CoV-2/steps/index.html since they are sourced from the same files and so won't get out of sync, but this is still possible if we would like to just have this tutorial show up in one place.

cli (RTD)

Only one redirect is necessary for this project's docs, and it has been configured and tested in anticipation of merging nextstrain/cli#102.

Please re-open this (or a more specific issue) if any issues arise with any of the redirects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants