Skip to content

Commit

Permalink
adding version in custom footer
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkern committed Jan 30, 2025
1 parent 2d5ba65 commit 1bddb25
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.footer {
margin-top: 20px;
text-align: center;
font-size: 0.9em;
color: #737373;
}
5 changes: 5 additions & 0 deletions docs/_templates/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% extends "!footer.html" %}
{% block extrafooter %}
{{ super() }}
<div class="footer">Version: {{ version }} ({{ release }})</div>
{% endblock %}
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx_rtd_theme",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
Expand Down Expand Up @@ -98,6 +99,14 @@
# further. For a list of options available for each theme, see the
# documentation.
#
html_context = {
"display_github": True,
"version": version,
"release": release,
}
html_theme_options = {
"version_selector": True,
}

# Show the version number in the navigation bar
html_show_sphinx = True
Expand All @@ -108,6 +117,11 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# Add custom CSS to style the footer
html_css_files = [
"custom.css",
]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
Expand Down

0 comments on commit 1bddb25

Please sign in to comment.