Skip to content

Commit

Permalink
Sphinx 6: Use logo_url instead of logo
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Jan 11, 2023
1 parent ce20cfc commit 2142c6d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,24 @@
<div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
{%- block sidebartitle %}

{%- if logo and theme_logo_only %}
{%- if ( logo or logo_url ) and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{%- else %}
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{%- endif %}

{%- if logo %}
{#- Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
{%- 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') }}"/>
{%- if sphinx_version_info < (4, 0) -%}
{# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
{%- if logo %}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{%- endif %}
{# Behavior since Sphinx 4 #}
{%- else %}
{% if logo_url %}
<img src="{{ logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
{%- endif %}
{%- endif %}

</a>

{%- if theme_display_version %}
Expand Down

0 comments on commit 2142c6d

Please sign in to comment.