diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index c8a3076..bf8519b 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -7,14 +7,13 @@ {%- set titlesuffix = "" %} {%- endif %} {%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} -{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%} {# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #} {%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%} {%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%} -= (7, 2) %} data-content_root="{{ content_root }}"{% endif %}> += (7, 2) %} data-content_root="{{ content_root }}"{% endif %}> {{- metatags }} @@ -24,10 +23,6 @@ {%- endblock -%} {#- CSS #} - {%- if sphinx_version_info < (4, 0) -%} - - - {%- endif %} {%- for css_file in css_files %} {%- if css_file|attr("filename") %} {{ css_tag(css_file) }} @@ -36,18 +31,19 @@ {%- endif %} {%- endfor %} - {# "extra_css_files" is a theme option and it's always a string #} + {# + "extra_css_files" is an undocumented Read the Docs theme specific option. + There is no need to check for ``|attr("filename")`` here because it's always a string. + Note that this option should be removed in favor of regular ``html_css_files``: + https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files + #} {%- for css_file in extra_css_files %} {%- endfor -%} - {#- FAVICON - favicon_url is the only context var necessary since Sphinx 4. - In Sphinx<4, we use favicon but need to prepend path info. - #} - {%- set _favicon_url = favicon_url | default(pathto('_static/' + (favicon or ""), 1)) %} - {%- if favicon_url or favicon %} - + {#- FAVICON #} + {%- if favicon_url %} + {%- endif %} {#- CANONICAL URL (deprecated) #} @@ -66,30 +62,9 @@ {%- if not embedded %} - {# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #} - {%- if sphinx_version_info >= (1, 8) -%} - {%- if sphinx_version_info < (4, 0) -%} - - {%- endif -%} - {%- for scriptfile in script_files %} - {{ js_tag(scriptfile) }} - {%- endfor %} - {%- else %} - - {%- for scriptfile in script_files %} - - {%- endfor %} - {%- endif %} + {%- for scriptfile in script_files %} + {{ js_tag(scriptfile) }} + {%- endfor %} {#- OPENSEARCH #}