Skip to content

Commit

Permalink
fix: source_docs_path according to conf_py_path
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Jun 8, 2023
1 parent 5057e23 commit 78cc0dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shibuya/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_edit_source_link(context: Dict[str, Any]):

source_user = context.get("source_user")
source_repo = context.get("source_repo")
source_docs_path = context.get("source_docs_path", "docs")
source_docs_path = context.get("source_docs_path", "/docs/")
source_edit_template = context.get("source_edit_template")

def edit_source_link(filename: str) -> str:
Expand All @@ -51,11 +51,11 @@ def edit_source_link(filename: str) -> str:
return

if source_type == "github":
return f"https://github.com/{source_user}/{source_repo}/blob/master/{source_docs_path}/{filename}"
return f"https://github.com/{source_user}/{source_repo}/blob/master{source_docs_path}{filename}"
elif source_type == "gitlab":
return f"https://gitlab.com/{source_user}/{source_repo}/-/blob/master/{source_docs_path}/{filename}"
return f"https://gitlab.com/{source_user}/{source_repo}/-/blob/master{source_docs_path}{filename}"
elif source_type == "bitbucket":
return f"https://bitbucket.org/{source_user}/{source_repo}/src/master/{source_docs_path}/{filename}"
return f"https://bitbucket.org/{source_user}/{source_repo}/src/master{source_docs_path}{filename}"

return edit_source_link

Expand Down

0 comments on commit 78cc0dd

Please sign in to comment.