forked from github/pelican
Fixes #645 - Making cross-content linking windows compatible
This commit is contained in:
parent
a2d585084e
commit
2692586abe
2 changed files with 6 additions and 0 deletions
|
|
@ -340,6 +340,9 @@ class StaticContent(object):
|
|||
settings = copy.deepcopy(_DEFAULT_CONFIG)
|
||||
self.src = src
|
||||
self.url = dst or src
|
||||
# On Windows, make sure we end up with Unix-like paths.
|
||||
if os.name == 'nt':
|
||||
self.url = self.url.replace('\\', '/')
|
||||
self.source_path = os.path.join(settings['PATH'], src)
|
||||
self.save_as = os.path.join(settings['OUTPUT_PATH'], self.url)
|
||||
|
||||
|
|
|
|||
|
|
@ -510,6 +510,9 @@ class StaticGenerator(Generator):
|
|||
for f in self.get_files(
|
||||
os.path.join(self.path, static_path), extensions=False):
|
||||
f_rel = os.path.relpath(f, self.path)
|
||||
# On Windows, make sure we end up with Unix-like paths.
|
||||
if os.name == 'nt':
|
||||
f_rel = f_rel.replace('\\', '/')
|
||||
# TODO remove this hardcoded 'static' subdirectory
|
||||
sc = StaticContent(f_rel, os.path.join('static', f_rel),
|
||||
settings=self.settings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue