diff --git a/hyde/engine.py b/hyde/engine.py index 999e068..943b2cb 100644 --- a/hyde/engine.py +++ b/hyde/engine.py @@ -88,6 +88,7 @@ class Engine(Application): incremental = False gen.generate_all(incremental=incremental) + logger.info("Generation complete.") @subcommand('serve', help='Serve the website') @store('-a', '--address', default='localhost', dest='address', diff --git a/hyde/ext/templates/jinja.py b/hyde/ext/templates/jinja.py index 06fa76f..5fa3f51 100644 --- a/hyde/ext/templates/jinja.py +++ b/hyde/ext/templates/jinja.py @@ -581,6 +581,13 @@ class Jinja2Template(Template): if jinja2_filters: jinja2_filters.register(self.env) + def clear_caches(self): + """ + Clear all caches to prepare for regeneration + """ + if self.env.bytecode_cache: + self.env.bytecode_cache.clear() + def get_dependencies(self, path): """ diff --git a/hyde/generator.py b/hyde/generator.py index be2ef7e..edea8f2 100644 --- a/hyde/generator.py +++ b/hyde/generator.py @@ -190,6 +190,7 @@ class Generator(object): """ logger.info("Reading site contents") self.load_template_if_needed() + self.template.clear_caches() self.initialize() self.load_site_if_needed() self.events.begin_site() diff --git a/hyde/template.py b/hyde/template.py index c507dac..59ed271 100644 --- a/hyde/template.py +++ b/hyde/template.py @@ -67,6 +67,12 @@ class Template(object): """ return + def clear_caches(self): + """ + Clear all caches to prepare for regeneration + """ + return + def get_dependencies(self, text): """ Finds the dependencies based on the included