We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8118908 commit b9726b8Copy full SHA for b9726b8
readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
@@ -120,6 +120,14 @@ context = {
120
'commit': {% if project.repo_type == 'git' %}'{{ commit|slice:"8" }}'{% else %}'{{ commit }}'{% endif %},
121
}
122
123
+# For sphinx >=1.8 we can use html_baseurl to set the canonical URL.
124
+# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_baseurl
125
+if version_info >= (1, 8):
126
+ if not globals().get('html_baseurl'):
127
+ html_baseurl = context['canonical_url']
128
+ context['canonical_url'] = None
129
+
130
131
{# Provide block for extending context data from child template #}
132
{% block extra_context %}{% endblock %}
133
0 commit comments