Adding comments to Pelican

I have said it before - I love using Pelican for writing my blog! Yet there is this one missing piece in writing a statically generated blog - the commenting system.

I mean yes - there are solutions to this problem. Still, I feel that none of them are fully satisfying.

In case of Pelican, there are ready-to-go plugins that make the experience of adding the possibility to comment a breeze. And there is one particular solution that looks very promising to me. Namely, the Pelican Comment System, which uses good old e-mail to 'post' the comment. That needs later processing, which of course, can be automated. But adding a form that is similar looking to the standard one found in any CMS with all of the fields already in place needs to use JavaScript. And I would like to avoid using this piece of technology here.

I have been using that plugin for my blog in the past but not any more due to the loss of previous configuration (remember to always make recoverable backups! Learn from my mistakes!) but now I don't feel like setting it up again.

Yet, I think I come up with decent idea to encourage discussion via mail without the hassle needed for setting up the plugin. And here it is - for all of you, Pelican users!

It is one file that you could include in your article.html template:

<hr>
<div id="comments-section">
    <a class="comments-button" href="mailto:jon.doe@example.com">Send me feedback via e-mail!</a>
</div>

On click visitors' browser should try to start their e-mail client. One neat thing is that you can prefill subject as well as body for them with Pelican variables like this:

<hr>
<div id="comments-section">
    <a class="comments-button" href="mailto:jon.doe@example.com?subject=Blog%20comment:{{ article.name }}&body=Hi%20Jon!">Send me feedback via e-mail</a>
</div>

For each article this part will then be generated with appropriate article name. I think this might be quite useful for some people, so use this 'hack' freely. Happy writing with Pelican!

WARNING! This article has been written a long time ago. It may no longer represent the current views of the author!


Consider commenting via e-mail

Newest in technical