Skip to content

Commit 9f22b91

Browse files
committed
Use root relative link and directory-style URL for plain text nodes
- Use root relative link instead of directory-relative URL which caused tags to be appended to the on-page tags for plaintext nodes. - Use directory-style URLs instead of appending .html to match the implementation for badges.
1 parent 4863328 commit 9f22b91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sphinx_tags/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def _get_plaintext_node(
115115
self, tag: str, file_basename: str, relative_tag_dir: Path
116116
) -> List[nodes.Node]:
117117
"""Get a plaintext reference link for the given tag"""
118-
link = relative_tag_dir / f"{file_basename}.html"
119-
return nodes.reference(refuri=str(link), text=tag)
118+
link = Path(self.env.app.config.tags_output_dir) / f"{file_basename}/"
119+
return nodes.reference(refuri="/" + str(link), text=tag)
120120

121121
def _get_badge_node(
122122
self, tag: str, file_basename: str, relative_tag_dir: Path

0 commit comments

Comments
 (0)