comment site
This commit is contained in:
parent
7ca4b5e057
commit
6469c911cd
2 changed files with 10 additions and 2 deletions
|
@ -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>
|
||||
|
|
10
makesite.py
10
makesite.py
|
@ -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…
Add table
Reference in a new issue