diff --git a/conf.py b/conf.py index 590f457e0c..8f198c1e05 100644 --- a/conf.py +++ b/conf.py @@ -35,6 +35,7 @@ 'demo_link', 'github_link', 'embedded_video', + 'sphinx_sitemap' ] # Add any paths that contain templates here, relative to this directory. @@ -304,6 +305,8 @@ # Where are stored the localisations files locale_dirs = ['locale/'] +i18n_url_scheme = "/{version}/{lang}/{link}" + LANGUAGES = { 'de': 'German', 'en': 'English', @@ -407,6 +410,10 @@ def localize(app, pagename, templatename, context, doctree): (la.split('_')[0] if la != 'en' else 'x-default', _build_url(app.config.canonical_root, (la != 'en' and la or ''), pagename)) for la in app.config.languages.split(',') ] + if not app.config.html_baseurl: + # remove last fragment containing the version + root = '/'.join(app.config.canonical_root.rstrip('/').split('/')[:-1]) + app.config["html_baseurl"] = root def canonicalize(app, pagename, templatename, context, doctree): """ Adds a 'canonical' URL for the current document in the rendering diff --git a/requirements.txt b/requirements.txt index 71121d994d..b10bbab41a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -Sphinx<2 \ No newline at end of file +Sphinx<2 +sphinx_sitemap