mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1328 from Scheirle/StaticGeneratorSignals
Send the static_generator_{init, finalized} signals
This commit is contained in:
commit
ddc5367231
2 changed files with 13 additions and 0 deletions
|
|
@ -643,6 +643,10 @@ class StaticGenerator(Generator):
|
|||
"""copy static paths (what you want to copy, like images, medias etc.
|
||||
to output"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(StaticGenerator, self).__init__(*args, **kwargs)
|
||||
signals.static_generator_init.send(self)
|
||||
|
||||
def _copy_paths(self, paths, source, destination, output_path,
|
||||
final_path=None):
|
||||
"""Copy all the paths from source to destination"""
|
||||
|
|
@ -671,6 +675,7 @@ class StaticGenerator(Generator):
|
|||
self.staticfiles.append(static)
|
||||
self.add_source_path(static)
|
||||
self._update_context(('staticfiles',))
|
||||
signals.static_generator_finalized.send(self)
|
||||
|
||||
def generate_output(self, writer):
|
||||
self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue