Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit cb22d71

Browse files
Make theme respect html_logo and html_favicon options if they are set in conf.py
Change logo to display as image to better support non 40x40 files
1 parent ac46c7e commit cb22d71

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

runestone/common/css/runestone-custom-sphinx-bootstrap.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,13 @@ div.section {
273273
.brand-logo {
274274
float: left;
275275
display: block;
276-
background-size: 40px 40px !important;
277-
width: 40px;
278-
height: 40px;
279276
margin-top: 4px;
280277
}
281278

279+
.brand-logo img {
280+
height: 40px;
281+
}
282+
282283
.social-menu {
283284
width: 220px;
284285
padding: 10px 10px 15px 20px;

runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
</button>
4040

4141
<div>
42+
{% set logo = '_static/' + (logo if logo else 'img/logo_small.png') %}
4243
{% if minimal_outside_links != 'True' %}
43-
<a class="brand-logo" style='background: transparent url("{{pathto('_static/img/logo_small.png', 1)}}") no-repeat 0px 0px;' href="/{{appname}}/default/user/login">&nbsp; </a>
44+
<a class="brand-logo" href="/{{appname}}/default/user/login" aria-label="Login"><img src="{{pathto(logo, 1)}}" alt=""></a>
4445
{% else %}
45-
<a class="brand-logo" style='background: transparent url("{{pathto('_static/img/logo_small.png', 1)}}") no-repeat 0px 0px;'>&nbsp;<span aria-label="logo" class="visuallyhidden">Runestone Logo</span> </a>
46+
<div class="brand-logo"><img src="{{pathto(logo, 1)}}" alt=""></div>
4647
{% endif %}
4748
<a class="navbar-brand" href="{{ pathto(master_doc) }}" aria-label="index-page">
4849
{% if dynamic_pages == 'True' %}
@@ -220,7 +221,10 @@
220221
{% endmacro %}
221222

222223
{%- block extrahead %}
224+
225+
{% if not favicon %}
223226
<link rel="shortcut icon" href="/{{appname}}/static/favicon.ico" type="image/ico" />
227+
{% endif %}
224228

225229
<script>
226230
eBookConfig = {};

0 commit comments

Comments
 (0)