Skip to content

Commit

Permalink
fix #122. fixed exception when there is no metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
zerasul committed Feb 20, 2020
1 parent 16dcd80 commit 4cb3963
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Blask/blogrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ def __init__(self, name, md, content):
self.name = name
meta = md.Meta
if meta:
self.date = datetime.strptime(meta["date"][0], "%Y-%m-%d")
self.tags = meta["tags"][0].split(",")
if "date" in meta.keys():
self.date = datetime.strptime(meta["date"][0], "%Y-%m-%d")
if "tags" in meta.keys():
self.tags = meta["tags"][0].split(",")
if "template" in meta.keys():
self.template = meta["template"][0]
if "category" in meta.keys():
Expand Down

0 comments on commit 4cb3963

Please sign in to comment.