From: Colin Watson Date: Tue, 1 Oct 2024 13:48:05 +0000 (+0100) Subject: Support loading comments from Mastodon X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=467b445c3d66c79caa119c846c47f2b5213caccc;p=blog.git Support loading comments from Mastodon Lightly adapted from: https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ --- diff --git a/m.css/pelican-theme/templates/article_footer.html b/m.css/pelican-theme/templates/article_footer.html index 6282168f..6e3330d3 100644 --- a/m.css/pelican-theme/templates/article_footer.html +++ b/m.css/pelican-theme/templates/article_footer.html @@ -1 +1,195 @@ +{% if MASTODON_HOST and MASTODON_USERNAME and article.metadata['mastodon-id'] %} +
+

Comments

+

With an account on the Fediverse or Mastodon, you can respond to this post. Since Mastodon is decentralized, you can use your existing account hosted by another Mastodon server or compatible platform if you don't have an account on this one. Known non-private replies are displayed below.

+

Learn how this is implemented here.

+ +

+
+ +
+ + + +
+{% endif %}

Posted{% if article.authors %} by {% for author in article.authors %}{{ author|e }}{% endfor %}{% endif %} on in {{ article.category|e }}.{% if article.modified %} updated {% endif %}{% if article.archived == 'True' %} archived{% endif %}{% if article.status == 'draft' %} draft{% endif %}{% if article.tags %} Tags: {% for tag in article.tags %}{{ tag|e }}{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}

diff --git a/pelicanconf.py b/pelicanconf.py index d833e04c..1ca72c37 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -56,3 +56,6 @@ M_LINKS_FOOTER2 = [ ('Liberapay', 'https://liberapay.com/cjwatson/donate'), ] M_SOCIAL_TWITTER_SITE = '@colmmacuait' + +MASTODON_HOST = 'mastodon.ie' +MASTODON_USERNAME = 'cjwatson'