summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2020-09-25 12:49:03 +0200
committerMarge Bot <eric+marge@anholt.net>2020-09-28 07:51:30 +0000
commitd2dfbf0e66bde6f671575fd6fe0c50e2facc2420 (patch)
tree5ea4bc7b88b9d0364656bc793c35350309a8b9e6 /docs
parent12760d0480d53da7218773ce3edae091e59607cb (diff)
downloadmesa-d2dfbf0e66bde6f671575fd6fe0c50e2facc2420.tar.gz
mesa-d2dfbf0e66bde6f671575fd6fe0c50e2facc2420.tar.bz2
mesa-d2dfbf0e66bde6f671575fd6fe0c50e2facc2420.zip
docs: store prefixes in redirects
This allows us to link to articles that are using pretty-URLs without adding an ugly "/index.html"-suffix to them. Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6862>
Diffstat (limited to 'docs')
-rw-r--r--docs/_exts/redirects.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/_exts/redirects.py b/docs/_exts/redirects.py
index af53f7f4fde..3c6009549f7 100644
--- a/docs/_exts/redirects.py
+++ b/docs/_exts/redirects.py
@@ -1,8 +1,8 @@
import os
redirects = [
- ('llvmpipe', 'gallium/drivers/llvmpipe'),
- ('postprocess', 'gallium/postprocess')
+ ('llvmpipe', 'gallium/drivers/llvmpipe.html'),
+ ('postprocess', 'gallium/postprocess.html')
]
def create_redirect(dst):
@@ -14,9 +14,8 @@ def create_redirects(app, docname):
return
for src, dst in redirects:
path = os.path.join(app.outdir, '{0}.html'.format(src))
- url = '{0}.html'.format(dst)
with open(path, 'w') as f:
- f.write(create_redirect(url))
+ f.write(create_redirect(dst))
def setup(app):
app.connect('build-finished', create_redirects)