Skip to content

Commit a28affe

Browse files
picnixzAA-Turner
andauthored
Properly support html_show_sphinx (#206)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
1 parent 285cfcc commit a28affe

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

alabaster/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ def get_path():
1515
def update_context(app, pagename, templatename, context, doctree):
1616
context["alabaster_version"] = __version__
1717

18+
# Convert 'show_powered_by' in the theme options to
19+
# the preferred option, html_show_sphinx.
20+
html_theme_options = app.config.html_theme_options
21+
if "show_powered_by" in html_theme_options:
22+
show_powered_by = html_theme_options["show_powered_by"]
23+
if isinstance(show_powered_by, str):
24+
context["show_sphinx"] = show_powered_by.lower() == "true"
25+
else:
26+
context["show_sphinx"] = bool(show_powered_by) # to allow int values
27+
1828

1929
def setup(app):
2030
app.require_sphinx("3.4")

alabaster/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@
8787
{%- block footer %}
8888
<div class="footer">
8989
{% if show_copyright %}&copy;{{ copyright }}.{% endif %}
90-
{% if theme_show_powered_by|lower == 'true' %}
90+
{% if show_sphinx %}
9191
{% if show_copyright %}|{% endif %}
9292
Powered by <a href="http://sphinx-doc.org/">Sphinx {{ sphinx_version }}</a>
9393
&amp; <a href="https://github.com/sphinx-doc/alabaster">Alabaster {{ alabaster_version }}</a>
9494
{% endif %}
9595
{%- if show_source and has_source and sourcename %}
96-
{% if show_copyright or theme_show_powered_by %}|{% endif %}
96+
{% if show_copyright or show_sphinx %}|{% endif %}
9797
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
9898
rel="nofollow">{{ _('Page source') }}</a>
9999
{%- endif %}

docs/customization.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ same.
191191
* ``show_powered_by``: Boolean controlling display of the ``Powered by
192192
Sphinx N.N.N. & Alabaster M.M.M`` section of the footer. When ``true``, is
193193
displayed next to the copyright information; when ``false``, is hidden.
194+
195+
.. deprecated:: 0.17.14
196+
Set ``html_show_sphinx`` to ``True`` or ``False`` in ``conf.py`` instead.
197+
194198
* ``show_relbars``: ``true`` or ``false`` - used to display *next* and
195199
*previous* links above and below the main page content. If you only want to
196200
display one, this setting can be further overridden through the

0 commit comments

Comments
 (0)