comment site

pull/1/head
Yax 5 years ago
parent 7ca4b5e057
commit 6469c911cd

@ -1,7 +1,7 @@
<div class="comment-detail">
<img src="https://www.gravatar.com/avatar/{{ avatar }}.jpg" style="float:left; margin-right:10px" height="32" width="32">
<div class="comment-body">
<span class="comment-author"><a href="{{ site }}">{{ author }}</a></span>
<span class="comment-author">{{ site_start }}{{ author }}{{ site_end }}</span>
</span><span> - {{ date }}</span>
<p>{{ content }}</p>
</div>

@ -248,11 +248,19 @@ def make_posts(
comments = resp.json()["data"]
out_comments = []
for comment in comments:
site=comment.get("site", "")
if site:
site_start = '<a href="' + site + '">'
site_end = '</a>'
else:
site_start = ''
site_end = ''
out_comment = render(
comment_layout,
author=comment["author"],
avatar=comment.get("avatar", ""),
site=comment.get("site", ""),
site_start=site_start,
site_end=site_end,
date=comment["date"],
content=markdown(comment["content"]),
)

Loading…
Cancel
Save