From 615decff3d78c98024747c498e1e7a80d7bfb318 Mon Sep 17 00:00:00 2001 From: Andrew Hearin Date: Mon, 9 Sep 2024 14:33:58 -0500 Subject: [PATCH] Define html_baseurl and html_context in conf.py --- docs/conf.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 37e03d26c..3690baf46 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,6 +2,7 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst # +import os from datetime import datetime, timezone from importlib import metadata @@ -79,6 +80,20 @@ html_static_path = ["_static"] html_style = "halotools.css" +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +html_context = { + "default_mode": "light", + "to_be_indexed": ["stable", "latest"], + "is_development": False, + "github_user": "astropy", + "github_repo": "halotools", + "github_version": "master", + "doc_path": "docs", + # Tell Jinja2 templates the build is running on Read the Docs + "READTHEDOCS": os.environ.get("READTHEDOCS", "") == "True", +} # -- Options for LaTeX output ------------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples