comment site

This commit is contained in:
Yax 2019-08-31 18:09:15 +02:00
parent 7ca4b5e057
commit 6469c911cd
2 changed files with 10 additions and 2 deletions

View file

@ -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"]),
)