diff --git a/.copier-answers.yml b/.copier-answers.yml index f78f899..c1cc666 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 2.0.2-4-g97e238d +_commit: 2.0.2-7-g382820b _src_path: gh:DiamondLightSource/python-copier-template author_email: tom.cobb@diamond.ac.uk author_name: Tom Cobb diff --git a/.github/pages/make_switcher.py b/.github/pages/make_switcher.py index e2c8e6f..0babd3c 100755 --- a/.github/pages/make_switcher.py +++ b/.github/pages/make_switcher.py @@ -55,9 +55,12 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]: def write_json(path: Path, repository: str, versions: str): org, repo_name = repository.split("/") + pages_url = f"https://{org}.github.io" + if repo_name != f"{org}.github.io": + # Only add the repo name if it isn't the source for the org pages site + pages_url += f"/{repo_name}" struct = [ - {"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"} - for version in versions + {"version": version, "url": f"{pages_url}/{version}/"} for version in versions ] text = json.dumps(struct, indent=2) print(f"JSON switcher:\n{text}") diff --git a/docs/conf.py b/docs/conf.py index da5f4d4..0e9d346 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -166,7 +166,7 @@ # A dictionary of values to pass into the template engine’s context for all pages html_context = { "github_user": github_user, - "github_repo": project, + "github_repo": github_repo, "github_version": version, "doc_path": "docs", }