Skip to content

Commit

Permalink
Fix URL in html_logo and html_favicon
Browse files Browse the repository at this point in the history
Since Sphinx 4, it's possible to use URL in html_logo and html_favicon
options. It is not currently processed correctly and we end up with
something like "_static/https://example.com/logo.png" as image path.

Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Sep 22, 2021
1 parent 330035b commit 523edd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/furo/theme/furo/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@

{# Favicon #}
{%- if favicon -%}
{%- if sphinx_version[0]|int < 4 -%}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- else %}
<link rel="shortcut icon" href="{{ favicon_url }}"/>
{%- endif %}
{%- endif -%}

{#- Generator banner -#}
Expand Down
4 changes: 4 additions & 0 deletions src/furo/theme/furo/sidebar/brand.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
{% block brand_content %}
{%- if logo %}
<div class="sidebar-logo-container">
{%- if sphinx_version[0]|int < 4 -%}
<img class="sidebar-logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
{%- else %}
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
{%- endif %}
</div>
{%- endif %}
{%- if theme_light_logo and theme_dark_logo %}
Expand Down

0 comments on commit 523edd9

Please sign in to comment.