Extension for Ansible redirects #2418
Draft
+4,458
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2147 and supercedes #2266
DRAFT: Still need to add some docs and other improvements but would like to get early feedback.
This PR extends the Sphinx reredirects extension to load redirects for Ansible documentation from a yaml file. The purpose is to replace the httpd mod_rewrite rules in https://github.com/ansible/docsite/blob/main/ansible/11/.htaccess and https://github.com/ansible/docsite/blob/main/.htaccess in a way that is compatible with ReadTheDocs.
The extension is enabled when
ENABLE_REDIRECTS
is true. You can achieve this withexport ENABLE_REDIRECTS=1
. In this way the extension does not run for core doc builds or when users build docs locally. We want to avoid this because the extension generates a large number of HTML files in the build directory, which can be really noisy.If this PR is accepted and merged, there are two follow on actions:
robots.txt
file to stop crawlers from indexing the generated HTML files. We can put therobots.txt
file in theansible/docsite
repo and copy it across as part of the ReadTheDocs build.docs/docsite/rst/user_guide
folder.