I currently use Jekyll to generate my blog posts that you see hosted here. One thing I have wanted was to add a commenting system. Inspired by this recent toot by @email@example.com, and as I am a proponent of the Fediverse and a Mastodon user, I took a first stab at setting up comments collected the notes below.
At the moment the comment solution closely based based on primary work by Carl Schwan and others who have built upon it. See the references section below for more information on the sources I drew upon.
Modifications to Jekyll
Two modifications were needed to get this working form my Jekyll blog set up. First I had to create the
fediverse_comments.html file and save it in the
_includes directory of my project. The contents of the file are currently as follows.
The second change I made was to modify the existing posts.html file in my project’s
_layouts directory to include the fesiverse_comments.html file (above) if the front matter for a post includes a comments section. The entire file is a below, but the lines that matter are:
Work Flow and Usage
Work Flow Enabling Comments for Article
- Create an article for publication on my web log in markdown.
- Create a toot on Mastodon linking to the article.
- Get the ID # of the toot from URL of expanded toot.
- Edit the original web log article and include comments section in the headmatter like such, replacing the id: with the value of that associated with the Mastodon toot related to the artcle:
- Save and republish the article with no other changes.
Replying and Viewing Comments
- To view comments (if any) in article in website, click Load Comments button at battom of post.
- Original toot and related comments should appear after a moment.
- If there is no Load Comments button, then the article does not have comments enabled.
- To reply or comment on an article:
- You should have an account on a Mastodon instance. It is possible other Fediverse accounts will work as well, but I have not tested.
- Click the reply button at the bottom of the article.
- If there is no Reply button then comments have not been enabled for the post.
- After clicking on Reply button, enter your account and Mastodon instance name in the format firstname.lastname@example.org in the field and click on Proceed to Reply and you should be taken to the toot and comments on Mastodon wher you can reply to the original post or one of the comments.
You can use a Mastodon accounti to comment on this article by replying to the associated Mastodon toot.