add has_in_tree_htaccess flag to template generator

Add a flag to tell us which projects have a .htaccess file in their
doc build output.

Change-Id: I0af0e32d9c646d61f4c72599cdc4613299aa5ec9
Depends-On: I236b7b0a9aae065167bd0aef316603d258e4c3c6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-07-31 17:21:01 -04:00
parent 1ca1404ca1
commit 079714fe21
3 changed files with 17 additions and 3 deletions

View File

@ -142,6 +142,10 @@ include a link to that documentation on the templated landing pages.
``has_admin_guide`` ``has_admin_guide``
produces a link to docs.o.o/name/latest/admin/ produces a link to docs.o.o/name/latest/admin/
``has_in_tree_htaccess``
enables full redirects to old paths, not just to the top of
/name/latest/
.. note:: .. note::
The documentation associated with the flags must exist before the The documentation associated with the flags must exist before the

View File

@ -60,9 +60,17 @@ redirectmatch 301 "^/project-install-guide/ocata/(.*)$" /ocata/install/$1
# Redirecting infra docs links to new developer location # Redirecting infra docs links to new developer location
redirectmatch 301 "^/infra/shade(.*)$" /developer/shade$1 redirectmatch 301 "^/infra/shade(.*)$" /developer/shade$1
# Redirecting old project developer docs to the new project home pages # Redirecting old project developer docs to the new layout. If a
# while leaving the index / project list page as it is. # project has an in-tree .htaccess file, assume it can handle the full
redirectmatch 301 "^/developer/([^/]+)/.*$" /$1/latest/ # path in the redirect. Otherwise, redirect everything to the new
# latest index.html.
{% for project in projects|sort(attribute='name') -%}
{%- if project.has_in_tree_htaccess %}
redirectmatch 301 "^/developer/{{project.name}}/(.*)$" /{{project.name}}/latest/$1
{%- else %}
redirectmatch 301 "^/developer/{{project.name}}/.*$" /{{project.name}}/latest/
{%- endif %}
{%- endfor %}
# Redirect old cli-reference to the OSC latest docs # Redirect old cli-reference to the OSC latest docs
redirectmatch 301 "^/cli-reference/.*$" /python-openstackclient/latest/ redirectmatch 301 "^/cli-reference/.*$" /python-openstackclient/latest/

View File

@ -41,3 +41,5 @@ items:
type: boolean type: boolean
has_user_guide: has_user_guide:
type: boolean type: boolean
has_in_tree_htaccess:
type: boolean