Skip to content

Commit 650b954

Browse files
committed
Fix support for files outside of site root directory on Windows
1 parent 71b6701 commit 650b954

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Features
1717
Bugfixes
1818
--------
1919

20+
* Fix support for files outside of site root directory on Windows
2021
* Support passing ``--backend`` and ``--db-file`` to ``nikola auto``
2122
* Support blank values in certain WordPress-imported structures
2223
(Issue #3535)

nikola/post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _set_paths(self, source_path):
253253
self.post_name = os.path.splitext(source_path)[0] # posts/blah
254254
_relpath = os.path.relpath(self.post_name)
255255
if _relpath != self.post_name:
256-
self.post_name = _relpath.replace('..' + os.sep, '_..' + os.sep)
256+
self.post_name = _relpath.replace('..' + os.sep, '__dotdot__' + os.sep)
257257
# cache[\/]posts[\/]blah.html
258258
self.base_path = os.path.join(self.config['CACHE_FOLDER'], self.post_name + ".html")
259259
# cache/posts/blah.html

0 commit comments

Comments
 (0)