docs: Add redirects
These were missed for some reason. Let's add them now. While we're here, we add the '-d DOCTREE_DIR' argument to our 'sphinx-build' call to handle Sphinx 1.8's change in behavior for where doctrees are output. Change-Id: I5c862a74f92a44bf5248f858e26826eef76c11f0 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
9d8eda8b82
commit
fd9670bd41
@ -5,3 +5,6 @@ sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
|
||||
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||
reno>=2.5.0 # Apache-2.0
|
||||
sphinxcontrib-apidoc>=0.2.0 # BSD
|
||||
|
||||
# redirect tests in docs
|
||||
whereto>=0.3.0 # Apache-2.0
|
||||
|
10
doc/source/_extra/.htaccess
Normal file
10
doc/source/_extra/.htaccess
Normal file
@ -0,0 +1,10 @@
|
||||
# The following is generated with:
|
||||
#
|
||||
# git log --follow --name-status --format='%H' ac25ae6fee.. -- doc/source/ | \
|
||||
# grep ^R | grep .rst | cut -f2- | \
|
||||
# sed -e 's|doc/source/|redirectmatch 301 ^/python-novaclient/([^/]+)/|' -e 's|doc/source/|/python-novaclient/$1/|' -e 's/.rst/.html$/' -e 's/.rst/.html/' | \
|
||||
# sort
|
||||
|
||||
redirectmatch 301 ^/python-novaclient/([^/]+)/api.html$ /python-novaclient/$1/reference/api/index.html
|
||||
redirectmatch 301 ^/python-novaclient/([^/]+)/man/nova.html$ /python-novaclient/$1/cli/nova.html
|
||||
redirectmatch 301 ^/python-novaclient/([^/]+)/shell.html$ /python-novaclient/$1/user/shell.html
|
@ -70,6 +70,10 @@ pygments_style = 'sphinx'
|
||||
# Sphinx are currently 'default' and 'sphinxdoc'.
|
||||
html_theme = 'openstackdocs'
|
||||
|
||||
# Add any paths that contain "extra" files, such as .htaccess or
|
||||
# robots.txt.
|
||||
html_extra_path = ['_extra']
|
||||
|
||||
# -- Options for openstackdocstheme -------------------------------------------
|
||||
|
||||
repository_name = 'openstack/python-novaclient'
|
||||
|
3
doc/test/redirect-tests.txt
Normal file
3
doc/test/redirect-tests.txt
Normal file
@ -0,0 +1,3 @@
|
||||
/python-novaclient/latest/api.html 301 /python-novaclient/latest/reference/api/index.html
|
||||
/python-novaclient/latest/man/nova.html 301 /python-novaclient/latest/cli/nova.html
|
||||
/python-novaclient/latest/shell.html 301 /python-novaclient/latest/user/shell.html
|
4
tox.ini
4
tox.ini
@ -46,7 +46,9 @@ deps =
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
commands =
|
||||
rm -rf doc/build
|
||||
sphinx-build -W -b html doc/source doc/build/html
|
||||
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
|
||||
# Test the redirects. This must run after the main docs build
|
||||
whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
|
||||
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
|
Loading…
Reference in New Issue
Block a user