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

Docs: Add some details to the User Defined Redirects #7894

Merged
merged 2 commits into from
Jun 7, 2021

Conversation

akien-mga
Copy link
Contributor

  • Move the "Implementation" section further up as a note, so that it's
    more visible (I missed it myself and spent some time trying to test
    redirects on 200 which do not work).
  • Add mentions to the use case of setting Exact Redirects to have
    Page Redirects but applied only to a specific version. It's common
    to move pages only in the latest branch/future stable branches,
    without doing the change in older branches.
  • The button to confirm a redirect is now named "Add".

I'm happy to amend the commit as needed if you disagree with some of the proposed changes.

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

docs/user-defined-redirects.rst Outdated Show resolved Hide resolved
Comment on lines 21 to 26
Since we serve documentation in a highly available way,
we do not run any logic when we're serving documentation.
This means that redirects will only happen in the case of a *404 File Not Found*.

In the future we might implement redirect logic in Javascript,
but this first version is only implemented in the 404 handlers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a little out of date, we run some logic when serving docs now. I think we can just mention that redirects only work on 404 (and maybe leave the second paragraph that mentions the js solution too).

# TODO: un-comment when ready to perform redirect here
# redirect_path, http_status = self.get_redirect(
# final_project,
# lang_slug,
# version_slug,
# filename,
# request.path,
# )
# if redirect_path and http_status:
# return self.get_redirect_response(request, redirect_path, http_status)

I think at this point we only need to make the decision on how to implement them and how to make it in a way that doesn't introduce a lot of queries to the db.

docs/user-defined-redirects.rst Show resolved Hide resolved
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jun 2, 2021
- Move the "Implementation" section further up as a note, so that it's
  more visible (I missed it myself and spent some time trying to test
  redirects on 200 which do not work). Remove part about not running
  logic as it's no longer accurate.
- Add mentions to the use case of setting Exact Redirects to have
  Page Redirects but applied only to a specific version. It's common
  to move pages only in the `latest` branch/future stable branches,
  without doing the change in older branches.
- The button to confirm a redirect is now named "Add".
@akien-mga akien-mga force-pushed the docs-user-defined-redirects branch from 716541a to 9c03f44 Compare June 2, 2021 19:20
@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jun 2, 2021
@akien-mga
Copy link
Contributor Author

Sorry for the late update. I've addressed the above feedback (the rewrite of the .. note:: likely needs another proofreading).

Copy link
Member

@stsewd stsewd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

docs/user-defined-redirects.rst Outdated Show resolved Hide resolved
@stsewd stsewd enabled auto-merge (squash) June 7, 2021 16:02
@stsewd stsewd merged commit a91bd99 into readthedocs:master Jun 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants