Skip to content

Commit

Permalink
Toggle to show/hide theme version in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vsalvino authored and laymonage committed Oct 28, 2024
1 parent dac8514 commit 6642ccd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

# -- Options for HTML output -------------------------------------------
html_theme = "sphinx_wagtail_theme"
html_show_sphinx = True
html_static_path = []
html_favicon = "favicon.ico"
# -- Options for HTMLHelp output ---------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions docs/customizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ are valid here. To disable, set to ``None``
html_last_updated_fmt = "%b %d, %Y"
Show Sphinx Theme in Footer
---------------------------

This built-in Sphinx feature will toggle on or off the "Created using Sphinx Wagtail Theme" in footer. By default it is on. To disable, set to ``False``. Useful if you want to see what version your docs are built with, or want to promote the project.

.. code-block:: python
html_show_sphinx = False
Custom Fonts & CSS
------------------

Expand Down
25 changes: 15 additions & 10 deletions sphinx_wagtail_theme/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@
</ul>
</nav>
{% endif %}
<div class="text-center">
{%- if last_updated %}
<p>Last updated: {{ last_updated|e }}</p>
{%- endif %}
<p style="display: none">
<a class="text-light" href="https://github.com/wagtail/sphinx_wagtail_theme" rel="nofollow" target="_blank">
Wagtail Sphinx Theme {{ theme_version|e }}
</a>
</p>
</div>
{%- if show_copyright %}
<div class="text-center">
{%- if hasdoc('Copyright') %}
Expand All @@ -33,6 +23,21 @@
{%- endif %}
</div>
{%- endif %}
{%- if last_updated or show_sphinx %}
<div class="text-center text-white-50 font-italic mt-3">
{%- if last_updated %}
<small>Last updated: {{ last_updated|e }}</small>
{%- endif %}
{%- if show_sphinx %}
<small>
Created using
<a href="https://github.com/wagtail/sphinx_wagtail_theme" rel="nofollow" target="_blank">
Sphinx Wagtail Theme {{ theme_version|e }}
</a>
</small>
{%- endif %}
</div>
{%- endif %}
</div>
</div>
{%- endblock %}

0 comments on commit 6642ccd

Please sign in to comment.