Skip to content

Commit

Permalink
docs: set the READTHEDOCS context variable (#1410)
Browse files Browse the repository at this point in the history
As of October 7th, the `html_context` dictionary is meant to contain a
`READTHEDOCS` key set to True if that's in the environment variables, so
this change does that.

We may see small changes in the visual look of the docs but everything
should keep working with this small adjustment.

[Instructions from Read the
Docs](https://about.readthedocs.com/blog/2024/07/addons-by-default/)

Fixes #1393
  • Loading branch information
tonyandrewmeyer authored Oct 8, 2024
1 parent 18e62cd commit 52c91cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import datetime
import os
import pathlib
import sys

Expand Down Expand Up @@ -137,6 +138,9 @@
# Valid options: none, prev, next, both
'sequential_nav': 'none',
}
# Addons-by-default, see: https://about.readthedocs.com/blog/2024/07/addons-by-default/
if os.environ.get('READTHEDOCS', '') == 'True':
html_context['READTHEDOCS'] = True

# If your project is on documentation.ubuntu.com, specify the project
# slug (for example, "lxd") here.
Expand Down

0 comments on commit 52c91cb

Please sign in to comment.