Skip to content

Commit ff131b8

Browse files
committed
Fix source of backslashes in URLs
1 parent 2b40c40 commit ff131b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nikola/nikola.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import logging
3434
import operator
3535
import os
36+
import pathlib
3637
import sys
3738
import mimetypes
3839
from collections import defaultdict
@@ -1926,7 +1927,8 @@ def path(self, kind, name, lang=None, is_link=False, **kwargs):
19261927
else:
19271928
return link
19281929
else:
1929-
return os.path.join(*path)
1930+
# URLs should always use forward slash separators, even on Windows
1931+
return pathlib.PurePosixPath(*path)
19301932

19311933
def post_path(self, name, lang):
19321934
"""Link to the destination of an element in the POSTS/PAGES settings.

0 commit comments

Comments
 (0)