@@ -70,7 +70,7 @@ class Engine(Application): | |||||
help='The configuration used to generate the site') | help='The configuration used to generate the site') | ||||
@store('-d', '--deploy-path', dest='deploy', default=None, | @store('-d', '--deploy-path', dest='deploy', default=None, | ||||
help='Where should the site be generated?') | help='Where should the site be generated?') | ||||
@true('-i', '--incremental', dest='incremental', default=False, | |||||
@true('-r', '--regen', dest='regen', default=False, | |||||
help='Only process changed files') | help='Only process changed files') | ||||
def gen(self, args): | def gen(self, args): | ||||
""" | """ | ||||
@@ -81,7 +81,12 @@ class Engine(Application): | |||||
site = self.make_site(args.sitepath, args.config, args.deploy) | site = self.make_site(args.sitepath, args.config, args.deploy) | ||||
from hyde.generator import Generator | from hyde.generator import Generator | ||||
gen = Generator(site) | gen = Generator(site) | ||||
gen.generate_all(incremental=args.incremental) | |||||
incremental = True | |||||
if args.regen: | |||||
logger.info("Regenerating the site...") | |||||
incremental = False | |||||
gen.generate_all(incremental=incremental) | |||||
@subcommand('serve', help='Serve the website') | @subcommand('serve', help='Serve the website') | ||||
@store('-a', '--address', default='localhost', dest='address', | @store('-a', '--address', default='localhost', dest='address', | ||||
@@ -76,13 +76,13 @@ class MetaPlugin(Plugin): | |||||
the resource. Load meta data by looking for the marker. | the resource. Load meta data by looking for the marker. | ||||
Once loaded, remove the meta area from the text. | Once loaded, remove the meta area from the text. | ||||
""" | """ | ||||
self.logger.info("Trying to load metadata from resource [%s]" % resource) | |||||
self.logger.debug("Trying to load metadata from resource [%s]" % resource) | |||||
yaml_finder = re.compile( | yaml_finder = re.compile( | ||||
r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n*", | r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n*", | ||||
re.MULTILINE) | re.MULTILINE) | ||||
match = re.match(yaml_finder, text) | match = re.match(yaml_finder, text) | ||||
if not match: | if not match: | ||||
self.logger.info("No metadata found in resource [%s]" % resource) | |||||
self.logger.debug("No metadata found in resource [%s]" % resource) | |||||
data = {} | data = {} | ||||
else: | else: | ||||
text = text[match.end():] | text = text[match.end():] | ||||
@@ -95,7 +95,7 @@ class MetaPlugin(Plugin): | |||||
else: | else: | ||||
resource.meta.update(data) | resource.meta.update(data) | ||||
self.__update_standard_attributes__(resource) | self.__update_standard_attributes__(resource) | ||||
self.logger.info("Successfully loaded metadata from resource [%s]" | |||||
self.logger.debug("Successfully loaded metadata from resource [%s]" | |||||
% resource) | % resource) | ||||
return text or ' ' | return text or ' ' | ||||