docs: create leading directories for redirects

This will be useful when removing entire directories from the docs,
which will happen in an upcoming patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7174>
This commit is contained in:
Erik Faye-Lund 2020-10-21 14:00:23 +02:00 committed by Marge Bot
parent b2c737cf57
commit a85c3189fa
1 changed files with 1 additions and 0 deletions

View File

@ -15,6 +15,7 @@ def create_redirects(app, docname):
return
for src, dst in redirects:
path = os.path.join(app.outdir, '{0}.html'.format(src))
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'w') as f:
f.write(create_redirect(dst))