From 6469c911cdb26414946cefc26d26c9974eabd6c9 Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Sat, 31 Aug 2019 18:09:15 +0200 Subject: [PATCH] comment site --- layout/comment.html | 2 +- makesite.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/layout/comment.html b/layout/comment.html index 26a489b..000f0b9 100644 --- a/layout/comment.html +++ b/layout/comment.html @@ -1,7 +1,7 @@
- {{ author }} + {{ site_start }}{{ author }}{{ site_end }} - {{ date }}

{{ content }}

diff --git a/makesite.py b/makesite.py index 0adcf5b..3145240 100755 --- a/makesite.py +++ b/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 = '' + site_end = '' + 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"]), )