From 3906334f4e9ce71b8f134a00c3db41d90d4a8bfa Mon Sep 17 00:00:00 2001 From: Pau Santana <127206784+psantana5@users.noreply.github.com> Date: Sun, 3 Aug 2025 21:39:14 +0200 Subject: [PATCH] feat: support project-specific RTD config --- docs/conf.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2e40507..8ce3692 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -54,6 +54,15 @@ }, } +rtd_config_file = os.environ.get("READTHEDOCS_CONFIG") +if rtd_config_file and not os.environ.get("PROJECT"): + config_name = os.path.basename(rtd_config_file) + base, _ = os.path.splitext(config_name) + if base.startswith(".readthedocs."): + project_name = base[len(".readthedocs."):] + if project_name: + os.environ["PROJECT"] = project_name + docset = get_project(multiproject_projects) # Disable custom 404 on dev docs @@ -161,9 +170,7 @@ "logo_only": True, } html_context = { - # Fix the "edit on" links. - # TODO: remove once we support different rtd config - # files per project. + # Fix the "edit on" links for each project. "conf_py_path": f"/docs/{docset}/", "display_github": True, "github_user": "readthedocs",