Adding Comments

Sun 17 August 2014
tags: meta

This website is currently fully static, meaning that there is currently no "backend" infrastructure: no server-side scripts and no database. With the addition of this blog I'd like to enable some form of comments on posts, however I'd still like to keep the backend framework with few moving parts. As with many things, this is a question that people have tackled long before me; a quick google for "static blog comments" reveals a wealth of (static) blog posts on the subject.

One popular possibility appears to be to use some external service such as disqus to host the comments. You put some javascript in your page which queries the external service and embeds the comments dynamically. While this is pretty neat, it kind of goes against the "bare bones" attitude I've taken towards this website so far (although with the inclusion of Bootstrap, jQuery and MathJax that position is probably less than defensible!).

Another approach is to use a form and a server-side script to process the comments, as described by Matt Palmer. Although other alternatives exist (notably Tomas Carnecky and his use of mailto: links), an extensive review of the topic by Tom Vincent served to convince me that using a PHP script and emails is probably the simplest option. I think the best way to do this is to have the server-side script email me, and have a local script which picks up the email content, commits it to the website's source tree, performs a website build and pushes it to the server. I think that this should work pretty well, all I need to do now is actually implement it...