Skip to content

Commit

Permalink
Fix RTD builds broken by the notebook header (#401)
Browse files Browse the repository at this point in the history
It's not clear what broke this or whether it was ever supposed to be used the way we had it before

`current_version` and `commit` are defined by https://github.com/readthedocs/readthedocs.org/blob/bc3e147770e5740314a8e8c33fec5d111c850498/readthedocs/doc_builder/backends/sphinx.py#L163-L205.

I can't work out where `READTHEDOCS` comes from, but `sphinx_rtd_theme` seems to use it like this.

This fixes the builds, although it might make the notebook links always use `master` which would be not ideal. I guess we'll find out.
  • Loading branch information
eric-wieser committed Jun 8, 2021
1 parent 350c693 commit 9e29823
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = 'docs/' + env.doc2path(env.docname, base=None) %}
{% set git_ref = 'master' if '.' not in env.config.current_version else 'v' + env.config.release %}
{% set git_ref = 'master' if not READTHEDOCS else
commit if '.' not in current_version else
'v' + env.config.release %}
.. raw:: html
<div class="admonition note">
Expand Down

0 comments on commit 9e29823

Please sign in to comment.