Skip to content

Commit

Permalink
Fix relative_to() path
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Apr 5, 2024
1 parent 3386c4c commit 614e8f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def linkcode_resolve(domain, info):
if full_file_name is None:
return None
try:
file_name = Path(full_file_name).resolve().relative_to(REPO_ROOT / "qiskit")
file_name = Path(full_file_name).resolve().relative_to(REPO_ROOT)
except ValueError:
return None

Expand All @@ -209,4 +209,4 @@ def linkcode_resolve(domain, info):
linespec = f"#L{lineno}-L{ending_lineno}"

github_branch = os.environ.get("QISKIT_DOCS_GITHUB_BRANCH_NAME", "main")
return f"https://github.com/Qiskit/qiskit/tree/{github_branch}/qiskit/{file_name}{linespec}"
return f"https://github.com/Qiskit/qiskit/tree/{github_branch}/{file_name}{linespec}"

0 comments on commit 614e8f8

Please sign in to comment.