Files
mesa/docs/_exts/redirects.py
Erik Faye-Lund e48b77b5b1 docs: remove webmaster article
This article is out-of-date, so let's instead forward to the "About
Mesa3D.org" article on the main website. This explains where to submit
merge requests for wanted changes.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6862>
2020-09-28 07:51:31 +00:00

23 lines
700 B
Python

import os
redirects = [
('llvmpipe', 'gallium/drivers/llvmpipe.html'),
('postprocess', 'gallium/postprocess.html'),
('webmaster', 'https://www.mesa3d.org/website/')
]
def create_redirect(dst):
tpl = '<html><head><meta http-equiv="refresh" content="0; url={0}"><script>window.location.replace("{0}")</script></head></html>'
return tpl.format(dst)
def create_redirects(app, docname):
if not app.builder.name == 'html':
return
for src, dst in redirects:
path = os.path.join(app.outdir, '{0}.html'.format(src))
with open(path, 'w') as f:
f.write(create_redirect(dst))
def setup(app):
app.connect('build-finished', create_redirects)