From 44ab1873d817bdb7347f02a40af49ecd0bc34910 Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Fri, 27 Sep 2024 08:17:01 -0600 Subject: [PATCH] Transition to Read the Docs Addons --- docs/source/conf/60-rtd.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/source/conf/60-rtd.py b/docs/source/conf/60-rtd.py index d1857d75a..5e273d51d 100644 --- a/docs/source/conf/60-rtd.py +++ b/docs/source/conf/60-rtd.py @@ -9,15 +9,20 @@ print(" rootpath: %s" % rootpath) print(" confpath: %s" % confpath) + html_static_path = [] + + # See https://about.readthedocs.com/blog/2024/07/addons-by-default/#how-to-opt-in-to-addons-now + html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True + import matplotlib matplotlib.use("agg") - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -if on_rtd: - html_static_path = [] else: + # Add any paths that contain custom static files (such as style sheets) here, + # relative to this directory. They are copied after the builtin static files, + # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"]