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

Extension for Ansible redirects #2418

Draft
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

oraNod
Copy link
Contributor

@oraNod oraNod commented Feb 14, 2025

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 with export 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:

  • Create a robots.txt file to stop crawlers from indexing the generated HTML files. We can put the robots.txt file in the ansible/docsite repo and copy it across as part of the ReadTheDocs build.
  • Remove all the existing stub files from this repository. For example, all the files under the docs/docsite/rst/user_guide folder.

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.

Using stub pages to replace redirects
1 participant