From 614e8f84b68348f68c153118b9cd2fc069f70695 Mon Sep 17 00:00:00 2001
From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Date: Fri, 5 Apr 2024 08:16:36 -0400
Subject: [PATCH] Fix relative_to() path

---
 docs/conf.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index fce2d805bfc8..f334406a7101 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -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
 
@@ -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}"