summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lesana/command.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/lesana/command.py b/lesana/command.py
index 15be857..3a3db55 100644
--- a/lesana/command.py
+++ b/lesana/command.py
@@ -275,17 +275,15 @@ class Export(Command):
for entry in results:
try:
template = collection.get_template(self.args.template)
- rendered = template.render(entry=entry)
- data = ruamel.yaml.load(
- template.render(entry=entry),
- ruamel.yaml.RoundTripLoader
- )
+ rendered = template.render(entry=entry, **entry.data)
except TemplatingError as e:
+ logging.error("Error converting entry: {}".format(entry))
logging.error("{}".format(e))
sys.exit(1)
try:
data = ruamel.yaml.load(rendered, ruamel.yaml.RoundTripLoader)
except ruamel.yaml.YAMLError as e:
+ logging.error("Error converting entry: {}".format(entry))
logging.error("{}".format(e))
sys.exit(1)
e = Entry(destination, data=data)