diff options
Diffstat (limited to 'sphinx_rtd_theme/layout.html')
-rw-r--r-- | sphinx_rtd_theme/layout.html | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index 6a4de94..99ec01b 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -9,8 +9,6 @@ {%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} {%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%} -{%- set sphinx_vn = parse_version(sphinx_version) -%} - <!DOCTYPE html> <html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" > <head> @@ -22,7 +20,7 @@ {%- endblock -%} {#- CSS #} - {%- if sphinx_vn < parse_version("4.0") -%} + {%- if sphinx_version_info < (4, 0) -%} <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> {%- endif %} @@ -40,7 +38,7 @@ {#- FAVICON #} {%- if favicon %} - {%- if sphinx_vn < parse_version("4.0") -%} + {%- if sphinx_version_info < (4, 0) -%} <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> {%- else %} <link rel="shortcut icon" href="{{ favicon_url }}"/> @@ -64,8 +62,8 @@ <![endif]--> {%- 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_vn >= parse_version("1.8") -%} - {%- if sphinx_vn < parse_version("4.0") -%} + {%- if sphinx_version_info >= (1, 8) -%} + {%- if sphinx_version_info < (4, 0) -%} <script id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> {%- endif -%} {%- for scriptfile in script_files %} @@ -141,7 +139,7 @@ {#- Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #} - {%- if sphinx_vn < parse_version("4.0") -%} + {%- if sphinx_version_info < (4, 0) -%} <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/> {%- else %} <img src="{{ logo_url }}" class="logo" alt="{{ _('Logo') }}"/> |