mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Fix support for logos as urls (#1171)
* Fix support for logos as urls Sphinx since 4.0 appears to support html_logo to also contain urls. As a consequence, the other themes in sphinx appear to be just using the new logo_url variable, and in this theme that fixes support for it, too. * Add backwards compatibility and add favicon_url Co-authored-by: Aaron Carlisle <carlisle.b3d@gmail.com>
This commit is contained in:
parent
380647d159
commit
3532ffc89b
@ -42,7 +42,11 @@
|
||||
|
||||
{#- FAVICON #}
|
||||
{%- if favicon %}
|
||||
{%- if sphinx_version_info < (4, 0) -%}
|
||||
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
|
||||
{%- else %}
|
||||
<link rel="shortcut icon" href="{{ favicon_url }}"/>
|
||||
{%- endif %}
|
||||
{%- endif -%}
|
||||
|
||||
{#- CANONICAL URL (deprecated) #}
|
||||
@ -139,7 +143,11 @@
|
||||
{#- 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') }}"/>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
</a>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user