diff --git a/HISTORY.md b/HISTORY.md index 4d67ba325..c74fb7b1f 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -20,6 +20,7 @@ #### Documentation +- Fix documentation conf for readthedocs deprecations ({pr}`485`) - Add novelty search with CMA-ES to sphere example ({pr}`478`, {pr}`482`) #### Improvements diff --git a/docs/conf.py b/docs/conf.py index e1d9b6570..3a1fbcf9f 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,6 +29,9 @@ sys.path.insert(0, os.path.abspath("..")) # Detect ribs. sys.path.append(os.path.abspath("./_ext")) # Detect extensions. +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + DEV_MODE = os.environ.get("DOCS_MODE", "regular") == "dev" READTHEDOCS_VERSION = os.environ.get("READTHEDOCS_VERSION", "stable") READTHEDOCS_LANGUAGE = os.environ.get("READTHEDOCS_LANGUAGE", "en") @@ -136,6 +139,10 @@ html_title = (f"pyribs (stable - v{version})" if READTHEDOCS_VERSION == "stable" else f"pyribs ({READTHEDOCS_VERSION})") +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True + # material theme options (see theme.conf for more information) html_theme_options = { "nav_title": "pyribs",