diff --git a/doc/requirements.txt b/doc/requirements.txt index 31a1639dcc..9cff0043b1 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -6,3 +6,4 @@ os-api-ref>=1.4.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD sphinxcontrib-httpdomain>=1.3.0 # BSD +whereto>=0.3.0 # Apache-2.0 diff --git a/doc/source/_extra/.htaccess b/doc/source/_extra/.htaccess new file mode 100644 index 0000000000..6e39f755fc --- /dev/null +++ b/doc/source/_extra/.htaccess @@ -0,0 +1,2 @@ +# renamed after the switch to Storyboard +redirectmatch 301 ^/sahara/([^/]+)/contributor/launchpad.html$ /sahara/$1/contributor/project.html diff --git a/doc/source/conf.py b/doc/source/conf.py index 7754c8a198..a1238a72dc 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -51,6 +51,10 @@ config_sample_basename = 'sahara' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] +# Add any paths that contain "extra" files, such as .htaccess or +# robots.txt. +html_extra_path = ['_extra'] + # The suffix of source filenames. source_suffix = '.rst' diff --git a/doc/test/redirect-tests.txt b/doc/test/redirect-tests.txt new file mode 100644 index 0000000000..a9e6a37db8 --- /dev/null +++ b/doc/test/redirect-tests.txt @@ -0,0 +1,3 @@ +/sahara/pike/contributor/launchpad.html 301 /sahara/pike/contributor/project.html +/sahara/queens/contributor/launchpad.html 301 /sahara/queens/contributor/project.html +/sahara/latest/contributor/launchpad.html 301 /sahara/latest/contributor/project.html diff --git a/tox.ini b/tox.ini index c0e4033531..0544c3ffc7 100644 --- a/tox.ini +++ b/tox.ini @@ -61,6 +61,7 @@ commands = rm -rf doc/source/apidoc doc/source/api sphinx-build -W -b html doc/source doc/build/html sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html + whereto doc/source/_extra/.htaccess doc/test/redirect-tests.txt whitelist_externals = rm [testenv:api-ref]