Skip to content

Commit

Permalink
Merge pull request #26 from melissawm/relpath
Browse files Browse the repository at this point in the history
  • Loading branch information
melissawm authored Sep 2, 2022
2 parents fc34251 + 5cfbaf4 commit b579205
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sphinx_tags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from docutils import nodes
from pathlib import Path

__version__ = "0.1.4"
__version__ = "0.1.4dev"

logger = getLogger("sphinx-tags")

Expand Down Expand Up @@ -47,7 +47,10 @@ def run(self):
# |
# - current_doc_path
docpath = Path(self.env.doc2path(self.env.docname)).parent
rootdir = os.path.relpath(self.env.app.config.tags_output_dir, docpath)
rootdir = os.path.relpath(
os.path.join(self.env.app.srcdir, self.env.app.config.tags_output_dir),
docpath,
)
link = os.path.join(rootdir, f"{tag}.html")
tag_node = nodes.reference(refuri=link, text=tag)
result += tag_node
Expand Down

0 comments on commit b579205

Please sign in to comment.