Probationary Comment System: Isso

It felt lonely in here, so I got Isso working for comments. Easy to nuke-and-pave if I don’t like it, at least. The whole “Python virtualenv” experience was a real pain in the ass, though, since pip install repeatedly claimed to have installed all the dependencies, while pip list called bullshit on that.

I’ll probably have to put Monit on the server in case it crashes, but that can wait.


It’s possible to have Isso dynamically update the comment count in the article metadata block, but I just spent about an hour failing to get it to work, between Isso’s and Hugo’s overlapping limitations.

On the Isso side, you can either show the comment form or add counts to a page. They’re conflicting JavaScript includes, according to the docs. I could write my own bit of jquery to make an ajax call to retrieve the count and insert it into the page, but I thought that would be more work.

Until I ran into Hugo’s variable-scoping. When you render content in a list context, you’re really fully rendering each page in its own context and then including the results. So, inside a template, variables like $.Kind and $.URL refer to the individual article’s context, as if you were currently writing out that one article to disk. And of the two completely different ways you can set variables, one of them is strictly block-scoped, and the other is strictly page-scoped. You can’t pass either down into a partial template.

(there’s a partial-with-arguments called a shortcode, but that’s a completely different beast, and I’m not sure it is either effective or efficient to replace all your partials with shortcodes) UPDATE: completely impossible, in fact; shortcodes don’t work in template files, and partial templates don’t work in content files. They’re completely different things with completely different behaviors. You have to construct a custom dictionary and pass it into a partial template, which is butt-ugly and error-prone.

So, yeah, no comment-count on the home page at the moment.

4/12 Update

I wrote my own bitty Jquery function to use Isso’s API directly and insert the comment count on page-load. It would be nice if the API returned “0” instead of 404 errors when there aren’t any comments, though.

Comments via Isso

Markdown formatting and simple HTML accepted.

Sometimes you have to double-click to enter text in the form (interaction between Isso and Bootstrap?). Tab is more reliable.