Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pydata_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def get_edit_url():
"Add %s to your `html_context` configuration" % val
)

# Enable optional custom github url for self-hosted github instances
github_url = "https://github.com"
if context.get("github_url"):
github_url = context["github_url"]

github_user = context["github_user"]
github_repo = context["github_repo"]
github_version = context["github_version"]
Expand All @@ -161,7 +166,7 @@ def get_edit_url():

# Build the URL for "edit this button"
url_edit = (
f"https://github.com/{github_user}/{github_repo}"
f"{github_url}/{github_user}/{github_repo}"
f"/edit/{github_version}/{doc_path}{file_name}"
)
return url_edit
Expand Down