forked from github/pelican
StaticGenerator now stores file list in context.
This allows plugins and other generators to easily add files to be simply copied over.
This commit is contained in:
parent
9645356eeb
commit
6191b2919e
1 changed files with 2 additions and 1 deletions
|
|
@ -562,13 +562,14 @@ class StaticGenerator(Generator):
|
|||
context_sender=self)
|
||||
self.staticfiles.append(static)
|
||||
self.add_source_path(static)
|
||||
self._update_context(('staticfiles',))
|
||||
|
||||
def generate_output(self, writer):
|
||||
self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme,
|
||||
self.settings['THEME_STATIC_DIR'], self.output_path,
|
||||
os.curdir)
|
||||
# copy all Static files
|
||||
for sc in self.staticfiles:
|
||||
for sc in self.context['staticfiles']:
|
||||
source_path = os.path.join(self.path, sc.source_path)
|
||||
save_as = os.path.join(self.output_path, sc.save_as)
|
||||
mkdir_p(os.path.dirname(save_as))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue