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 753ce19 commit fd60d5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion material/plugins/tags/plugin.py
Expand Up @@ -19,6 +19,7 @@
# IN THE SOFTWARE.

import logging
import os
import sys

from collections import defaultdict
Expand Down Expand Up @@ -109,9 +110,12 @@ def __render_tag_links(self, tag, pages):
page.file.src_path,
self.tags_file.src_path
)

# 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
url.replace(os.path.sep, "/")
))

# Return rendered tag links
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/tags/plugin.py
Expand Up @@ -19,6 +19,7 @@
# IN THE SOFTWARE.

import logging
import os
import sys

from collections import defaultdict
Expand Down Expand Up @@ -109,9 +110,12 @@ def __render_tag_links(self, tag, pages):
page.file.src_path,
self.tags_file.src_path
)

# 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
url.replace(os.path.sep, "/")
))

# Return rendered tag links
Expand Down

0 comments on commit fd60d5b

Please sign in to comment.