diff --git a/plugins/pelican_comments/pelican_comments.py b/plugins/pelican_comments/pelican_comments.py index 80d9ec3..66edcd4 100644 --- a/plugins/pelican_comments/pelican_comments.py +++ b/plugins/pelican_comments/pelican_comments.py @@ -8,7 +8,7 @@ import collections import hashlib # libravatar import pelican.signals as signals -import pelican.generators as generators +# import pelican.generators as generators import pelican.readers as readers from pelican.contents import Content @@ -87,12 +87,13 @@ class CommentReader(object): (comment_filename, )) self._comments[comment.metadata['post_id']].append(comment) - # Libravatar + # LibreAvatar + librevatar_url = 'https://cdn.libravatar.org/avatar' # Check the presence of the Email header if 'email' in comment.metadata: email = comment.metadata['email'].encode('utf-8') ehash = hashlib.md5(email.strip().lower()).hexdigest() - comment.avatar = "https://cdn.libravatar.org/avatar/%s" % (ehash) + comment.avatar = "%s/%s" % (librevatar_url, ehash) else: raise Exception("comment %s does not have a email" % (comment_filename))