kaimi.cc

203: Non-Authoritative Information

You don’t have a say in this!

… nonetheless I have added a the ability to comment on posts. It has been fiddly, but it is working for now.

I am running Octopress here. Its purpose is to be able to serve static HTML but to have a fully functional blogging software at your proposal at the same time. How do you add comments to this mix? Comments are user-generated (duh), so it is a tad difficult to integrate them into a static site. The “standard” way of doing things is signing up for a disqus account and including their JS-powered threads in your post layout. But that kind of defeats the purpose, doesn’t it?

So I decided to go for another route. I found jekyll-static-comment, a plugin for jekyll, the engine below Octopress. It adds a single php script that handles POST data generated by a comment form and sends an email to a predefined address. You pick up the mail, drop it into a specific directory in your page source, regenerate, reupload, et voilà, comments.

I wanted something different. I wanted absolutely no server side dynamic elements and static html only. So I took the plugin, got rid of the php bits and modified the comment form to just send an email to site.email instead. This requires a bit more interaction on the receiving side, as the form sends key=value pairs instead of the required key: value YAML pairs. Maybe I will work on that later, perhaps integrate the conversion into Octopress’ generate task.

Whatever, you can find the comment section below. Have fun. As you might have guessed, comments take some time to be published. Each one has to be processed manually.

1 Comment

ka’imi2013-07-27 19:23

This is an example comment! :D

Post a comment

Your email address will not be published. The form doesn’t spit out an email? Go get a real browser and/or mail client.

Name:
Website: