- Moving away from Blogger: comments using Disqus (15 June 2015)
One of the issues that I needed to face when I decided to move my blog from
Jekyllis how to preserve comments on posts.
Please welcome Disqus
Disqus is a discussion (or forum) platform that can be integrated in any content available on the web. In order to integrate something with Disqus the only requirement is that
thesomething can be uniquely identified, and a blog post
permalinkis an amazing unique identifier :-)
One of the interesting things that Disqus can do is to integrate itself with Blogger and keep blog post comments synchronized with Disqus comments. Automatically Discqus will utilize the post
permalinkas the comments unique identifier.
Once Disqus is in sync with Blogger the blog content can be safely moved to another platform.
Adding Disqus to Jekyll
Adding Disqus to Jekyll is as easy as adding the following snippet to the Jekyll post template:
But for imported posts it is not enough, comments won’t show up using the above, the commenting form will be displayed but existing comments no. The issue is that the Blogger generated
permalinkis not the same as the Jekyll one:
easy peasy, once again.
to identify the Blogger original URL, what I simply did is to update each imported post adding a
permalinkheader as well:
blogger_orig_url: http://milestone.topics.it/2013/04/ravendb-worker-role-on-windows-azure.html permalink: /2013/04/ravendb-worker-role-on-windows-azure.html
permalinkheader, when used at the post level, overrides the Jekyll default
permalinkgeneration behavior for that specific post adding 2 great benefits to the new blog:
- Old links are still supported, so all the posts linked anywhere will work as expected;
- Synchronized Disqus comments show up appended to the posts they belong to;
- Jekyll: A new home for this blog (12 June 2015)
I decided to move this blog from Blogger, where it was hosted, to GitHub pages, the main reason that drove this decision is the European cookie law and the absurd way it is applied in Italy, basically forcing me to pay taxes for a thing I am not using but that I cannot disable.
The interesting thing of GitHub Pages is that they support Jekyll, a ruby powered, blog aware, content generation engine that can generate static sites. And if you think about it a blog is a static thing.
The blog template I’m actually using is the default one, I don’t like it, I have a plan to create my own template, a long term plan :-)
- If you can see this, it worked (12 June 2015)
One of the things that Jekyll misses is the ability to schedule future posts, but…
Zapier to the rescue
Zapier is nice and powerful mesh-up engine that allows you to connect different services, react based on triggers and perform actions.
Here is my blog posts scheduling work-flow:
- create a branch to host the new post;
- write the post in the new branch;
- push the branch to remote;
- create an event in my Google Calendar to schedule the publish:
- use as
locationthe name of the branch;
- use as
I finally created in Zapier a trigger for the Google Calendar event that when the event is fired:
- automatically creates a
Pull Requestfor the branch defined in the
- if there are no merge conflicts immediately merges the PR;
Once the PR is merged into the
masterbranch Jekyll automatically kicks in and
compilesthe markdown document and
The interesting thing of using a calendar to schedule posts is that you can easily move them to a new schedule and cancel the publish simply deleting the appointment in the calendar without affecting the post sitting in the branch.