From 9a7c167e7367206026e3b7fd4349addcdf706475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 11 Sep 2019 10:33:25 +0200 Subject: [PATCH] doc: switch to a nicer URL scheme. --- doc/python/conf-public.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/python/conf-public.py b/doc/python/conf-public.py index 4e38b78..1935c3d 100644 --- a/doc/python/conf-public.py +++ b/doc/python/conf-public.py @@ -22,6 +22,19 @@ STYLESHEETS = [ FAVICON = 'https://doc.magnum.graphics/favicon.ico' -SEARCH_DOWNLOAD_BINARY = True +SEARCH_DOWNLOAD_BINARY = 'searchdata-v1.bin' SEARCH_BASE_URL = 'https://doc.magnum.graphics/python/' SEARCH_EXTERNAL_URL = 'https://google.com/search?q=site:doc.magnum.graphics+Magnum+Python+{query}' + +def URL_FORMATTER(type, path): + # Put static files into the root, everything else into subdirs + if type.name == 'STATIC': + prefix = os.path.basename(path[0]) + return prefix, '/python/' + prefix + + # And special casing for index, of course + if type.name == 'PAGE' and len(path) == 1 and path[0] == 'index': + return 'index.html', '/python/' + + prefix = '/'.join(path) + '/' + return prefix + 'index.html', '/python/' + prefix