Skip to content

Commit 4c83da5

Browse files
authored
Merge pull request #104 from epics-containers/fix-switcher
Update switcher to work for org pages sites
2 parents 60fdb14 + 2d980b8 commit 4c83da5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/pages/make_switcher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ def get_versions(ref: str, add: Optional[str]) -> List[str]:
5555

5656
def write_json(path: Path, repository: str, versions: str):
5757
org, repo_name = repository.split("/")
58+
pages_url = f"https://{org}.github.io"
59+
if repo_name != f"{org}.github.io":
60+
# Only add the repo name if it isn't the source for the org pages site
61+
pages_url += f"/{repo_name}"
5862
struct = [
59-
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
63+
{"version": version, "url": f"{pages_url}/{version}/"}
6064
for version in versions
6165
]
6266
text = json.dumps(struct, indent=2)

0 commit comments

Comments
 (0)