mirror of
https://github.com/envmodules/modules.git
synced 2026-05-30 00:12:31 +08:00
doc: add RTD version-switch div on furo theme
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This commit is contained in:
22
doc/source/_templates/sidebar/brand.html
Normal file
22
doc/source/_templates/sidebar/brand.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<a class="sidebar-brand{% if logo %} centered{% endif %}" href="{{ pathto(master_doc) }}">
|
||||
{%- block brand_content %}
|
||||
{#- Remember to update the prefetch logic in `block logo_prefetch_links` in base.html #}
|
||||
{%- if logo_url %}
|
||||
<div class="sidebar-logo-container">
|
||||
<img class="sidebar-logo" src="{{ logo_url }}" alt="Logo"/>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{%- if theme_light_logo and theme_dark_logo %}
|
||||
<div class="sidebar-logo-container">
|
||||
<img class="sidebar-logo only-light" src="{{ pathto('_static/' + theme_light_logo, 1) }}" alt="Light Logo"/>
|
||||
<img class="sidebar-logo only-dark" src="{{ pathto('_static/' + theme_dark_logo, 1) }}" alt="Dark Logo"/>
|
||||
</div>
|
||||
{%- endif %}
|
||||
{% if not theme_sidebar_hide_name %}
|
||||
<span class="sidebar-brand-text">{{ docstitle if docstitle else project }}</span>
|
||||
{%- endif %}
|
||||
{% endblock brand_content %}
|
||||
</a>
|
||||
{%- if READTHEDOCS %}
|
||||
<div class="version-switch"></div>
|
||||
{%- endif %}
|
||||
@@ -140,6 +140,9 @@ if os_rtd:
|
||||
'light_logo': 'modules_red.svg',
|
||||
'dark_logo': 'modules_white.svg',
|
||||
}
|
||||
html_context = {
|
||||
'READTHEDOCS': True,
|
||||
}
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
|
||||
Reference in New Issue
Block a user