my eye

Fix content rendering of entries

Committed 03f7e6

--- a/webint_posts/templates/entry.html
+++ b/webint_posts/templates/entry.html

 $ type = discover_post_type(entry)
 
 $def render_content(entry):
-    $ content = entry["content"][0]
-    $if isinstance(content, dict) and "html" in content:
-        <div class=e-content>$:post_mkdn(content["html"])</div>
-    $else:
-        <div class=p-content>$:post_mkdn(content)</div>
+    $if "content" in entry:
+        $ content = entry["content"][0]
+        <div id=previewContent>
+        $if isinstance(content, dict) and "html" in content:
+            <div class=e-content>$:post_mkdn(content["html"])</div>
+        $else:
+            <div class=p-content>$:post_mkdn(content)</div>
+        </div>
 
 $if type == "note":
-    <div id=previewContent>$render_content(entry)</div>
+    $render_content(entry)
 $elif type == "article":
     $var title = entry["name"][0]
-    <div id=previewContent>$render_content(entry)</div>
+    $render_content(entry)
 $elif type == "weight":
     <h2 class=p-summary>$entry["summary"][0]</h2>
     $ weight = entry["weight"][0]
     <p>RSVP <strong class=p-rsvp
         style="color:$colors[entry['rsvp'][0]]);">$entry["rsvp"][0]</strong> to
     <a class=u-in-reply-to href=$in_reply_to>$in_reply_to</a></p>
-    <div id=previewContent>$render_content(entry)</div>
+    $render_content(entry)
 $else:
     <p>$type</p>