GMLC-TDC / HELICS

Hierarchical Engine for Large-scale Infrastructure Co-Simulation (HELICS)
https://docs.helics.org/en/latest/
BSD 3-Clause "New" or "Revised" License
126 stars 40 forks source link

Define html_baseurl in ReadTheDocs configuration #2664

Closed nightlark closed 4 months ago

nightlark commented 4 months ago

tldr; RTD has been doing some behind the scenes context manipulation for Sphinx configuration, which is going away. To keep things working, add a block like this to conf.py for ReadTheDocs by Oct 7, 2024:

import os

# Define the canonical URL if you are using a custom domain on Read the Docs
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")

# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
    html_context["READTHEDOCS"] = True

Full blog post with info on the change: https://about.readthedocs.com/blog/2024/07/addons-by-default/

trevorhardy commented 4 months ago

Additions made to the conf.py; thanks for the heads-up @nightlark.

We'll have to remember to reconfigure RTD when we merge this into main.

https://docs.readthedocs.io/en/stable/addons.html#enabling-read-the-docs-addons

Changes made here: https://github.com/GMLC-TDC/HELICS/blob/5c331302a6c983c191b36eee7d16beba0404ce18/docs/conf.py