Skip to content

Commit

Permalink
Fixed issue with OS-specific paths in tags plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed May 1, 2022
1 parent 43a6d92 commit 36d5081
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions material/plugins/tags/plugin.py
Expand Up @@ -107,15 +107,15 @@ def __render_tag_links(self, tag, pages):
content = [f"## <span class=\"md-tag\">{tag}</span>", ""]
for page in pages:
url = utils.get_relative_url(
page.file.src_path,
self.tags_file.src_path
page.file.src_path.replace(os.path.sep, "/"),
self.tags_file.src_path.replace(os.path.sep, "/")
)

# Ensure forward slashes, as we have to use the path of the source
# file which contains the operating system's path separator.
content.append("- [{}]({})".format(
page.meta.get("title", page.title),
url.replace(os.path.sep, "/")
url
))

# Return rendered tag links
Expand Down

0 comments on commit 36d5081

Please sign in to comment.