Fixes #645 - Making cross-content linking windows compatible

This commit is contained in:
Irfan Ahmad 2012-12-19 17:06:44 +05:00 committed by Alexis Métaireau
commit 2692586abe
2 changed files with 6 additions and 0 deletions

View file

@ -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)