-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add Sphinx redirects for latest pages #2266
base: devel
Are you sure you want to change the base?
Conversation
with yaml_file.open(mode="r", encoding="utf-8") as f: | ||
file_redirects = yaml.safe_load(f) | ||
if file_redirects: | ||
redirects.update(file_redirects) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I formatted the entire conf.py
file, which might not be something we want to do for this PR because it makes it a little hard to see exactly what changed. I can revert that. Although I think formatting at some point would be a good idea.
Also not sure if this is too much cowbell or what. I mean initializing redirects and checking that things exist. Maybe this could be a lot simpler with fewer lines? I'd appreciate feedback on that please.
Hint: You can see the redirects in action with the RTD preview: https://ansible--2266.org.readthedocs.build/projects/ansible-core/2266/ Append some of the source paths from the https://ansible--2266.org.readthedocs.build/projects/ansible-core/2266/ansible.html redirects to https://ansible--2266.org.readthedocs.build/projects/ansible-core/2266/cli/ansible.html |
Fixes #2147
This PR adds the Sphinx reredirects extension so that we can replace the latest redirects with something that is easier to maintain and provides a better user experience than stub pages.
For more detail, also see the conversation here: ansible/docsite#261 (comment)
Here are some comments about the files in the
_data
subdirectory:_data/pages.yaml
these are redirect rules forlatest|devel
that I took from https://github.com/ansible/docsite/blob/main/.htaccessI'm not sure if we really want to add those redirects to core docs but those are pages that were in core docs at some point and were moved. So it seems reasonable.
_data/plugins.yaml
these are redirect rules forplugins/*
pages from https://github.com/ansible/docsite/blob/main/ansible/11/.htaccess_data/modules.yaml
these are redirect rules formodules/*
pages that come from the same.htaccess
file as the plugins. Still need to go through and determine the best collection to use as the target redirect for most of these but it's not an impossible task. Rather than pointing to specific modules, I suggest we point to the main collection. This is in keeping with the effort to reduce maintenance burden for all these redirects.data/deprecated_modules.yaml
these are redirects formodules/*
pages that have the deprecation notice. If / when these collections are removed, we can point to thedocs.ansible.com/collections.html
page.