Skip to content

Commit 015b52a

Browse files
committed
MNT: restore ability to put the sha of the docs in the output
The commit the docs are built from may be different from the commit of the installed library. This is always the case for our published documentation.
1 parent 242487f commit 015b52a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

mpl_sphinx_theme/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ def mpl_path(path):
3131
# For more details, see:
3232
# https://www.sphinx-doc.org/en/master/development/theming.html#distribute-your-theme-as-a-python-package
3333
def setup(app):
34-
app.add_html_theme("mpl_sphinx_theme",
35-
str(Path(__file__).parent.resolve()))
34+
here = Path(__file__).parent.resolve()
35+
# Include component templates
36+
app.config.templates_path.append(str(here / "components"))
37+
38+
app.add_html_theme("mpl_sphinx_theme", str(here))
3639
app.connect("html-page-context", setup_html_page_context)
3740
return {'version': __version__, 'parallel_read_safe': True}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% if lib_version %}
2+
<p class="sphinx-version">
3+
Built from {{ lib_version }}.
4+
<br/>
5+
</p>
6+
{% endif %}

0 commit comments

Comments
 (0)