1
0
Fork 0
forked from github/pelican

Merge pull request #2246 from mosra/theme-static-paths-files

Make THEME_STATIC_PATHS work for files as well
This commit is contained in:
Justin Mayer 2018-02-10 11:29:06 -08:00 committed by GitHub
commit f7681f7259
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 6 deletions

View file

@ -730,14 +730,21 @@ class StaticGenerator(Generator):
final_path=None):
"""Copy all the paths from source to destination"""
for path in paths:
source_path = os.path.join(source, path)
if final_path:
copy(os.path.join(source, path),
os.path.join(output_path, destination, final_path),
self.settings['IGNORE_FILES'])
if os.path.isfile(source_path):
destination_path = os.path.join(output_path, destination,
final_path,
os.path.basename(path))
else:
destination_path = os.path.join(output_path, destination,
final_path)
else:
copy(os.path.join(source, path),
os.path.join(output_path, destination, path),
self.settings['IGNORE_FILES'])
destination_path = os.path.join(output_path, destination, path)
copy(source_path, destination_path,
self.settings['IGNORE_FILES'])
def _file_update_required(self, staticfile):
source_path = os.path.join(self.path, staticfile.source_path)