diff --git a/docs/_templates/page.html b/docs/_templates/page.html index 00268aa..132bef7 100644 --- a/docs/_templates/page.html +++ b/docs/_templates/page.html @@ -12,7 +12,10 @@ {%- block extrahead %} {{ super() }} - + {%- if site_baseurl -%} + + {%- else -%} + + {%- endif -%} - {%- endblock -%} diff --git a/docs/conf.py b/docs/conf.py index 8a6c109..df5ef9f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -151,3 +151,9 @@ def setup(app): app.add_css_file("custom.css") app.add_js_file("redirect.js") + + # Make html_baseurl available in templates as site_baseurl + def add_baseurl_to_context(app, pagename, templatename, context, doctree): + context['site_baseurl'] = app.config.html_baseurl + + app.connect('html-page-context', add_baseurl_to_context)