From 467b445c3d66c79caa119c846c47f2b5213caccc Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 1 Oct 2024 14:48:05 +0100 Subject: [PATCH] Support loading comments from Mastodon Lightly adapted from: https://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/ --- .../templates/article_footer.html | 194 ++++++++++++++++++ pelicanconf.py | 3 + 2 files changed, 197 insertions(+) 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' -- 2.30.2