code: def prepare(self):
  
          self.body_html = markdown(
              codecs.open(self.abspath, 'r').read(),
              extras=['fenced-code-blocks', 'hilite', 'tables', 'metadata'])
  
          self.header = self.body_html.metadata
          
          if 'tags' in self.header:  # pages can lack tags
              self.header['tags'] = [t.strip().lower() for t in
                                     self.header['tags'].split(',')]
  
          else:
              self.header['tags'] = ("",)
  
          self.date = self.header.get('published', datetime.datetime.now())
  
          if isinstance(self.date, str):
              self.date = datetime.datetime.strptime(self.date, "%Y-%m-%d")
  
          for k, v in self.header.items():
              try:
                  setattr(self, k, v)
              except AttributeError:
                  pass
  
          if self.id:
              return
  
          rec = {'filename': self.path,
                 'mtime': int(os.path.getmtime(self.abspath))}
  
          if self.header['kind'] == 'writing':
              _id = Entry.db.posts.insert(rec)
  
          elif self.header['kind'] == 'page':
              _id = Entry.db.pages.insert(rec)
  
          self.id = _id
docs: a blog post without tags causes an error ...