From fdf0e21515f6dde2a5cfe22321cf9a0ce0e490d3 Mon Sep 17 00:00:00 2001 From: "Oriol (ZBook)" Date: Mon, 10 Jan 2022 02:18:51 +0200 Subject: [PATCH] allow retrieving doi code from rtd --- examples/conf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/conf.py b/examples/conf.py index 9e85afecb..9893f5a80 100644 --- a/examples/conf.py +++ b/examples/conf.py @@ -70,7 +70,8 @@ ], } version = os.environ.get("READTHEDOCS_VERSION", "") -version = version if "-" in version else "main" +version = version if "." in version else "main" +doi_code = os.environ.get("READTHEDOCS_DOI", "10.5281/zenodo.5654871") html_context = { "github_url": "https://github.com", "github_user": "pymc-devs", @@ -78,8 +79,8 @@ "github_version": version, "doc_path": "examples/", "sandbox_repo": f"pymc-devs/pymc-sandbox/{version}", - "doi_url": "https://doi.org/10.5281/zenodo.5654871", - "doi_code": "10.5281/zenodo.5654871", + "doi_url": f"https://doi.org/{doi_code}", + "doi_code": doi_code, } @@ -122,6 +123,7 @@ "pip_dependencies": "{{ extra_dependencies }}", "conda_dependencies": "{{ extra_dependencies }}", "extra_install_notes": "", + "doi_code": doi_code, } jupyter_execute_notebooks = "off"