I've been tooling around on my website and decided to try something a little new. I used to run WordPress, which uses MySQL as a back-end. This can cause problems — MySQL hogs resources like Gollum with a ring, and querying the database every time someone hits the site slows everything down. When my blog got the hug of death from Hacker News a few months ago, the amount of time and resources it took to serve the pages killed my server deader that corduroy.
About a week ago I read about Pelican, a Python tool that lets you write everything in Markdown and then generates static HTML output — no database, fewer server resources, and faster load times. Unfortunately this means you lose your blog's comments, but I realized the most conversation about any of my posts has never actually been on my blog. Nowadays all that discussion happens on social websites like Hubski or Reddit. Having your own comments section is all a little bit 90s.
mk helped me implement Discussion via Hubski on my website a while ago. This uses some JavaScript to make a query to Hubski every time someone views a post and embed the results. But I was itching to try something a little bit different. I wrote a plugin for Pelican (really just a very basic Python script) so that when you generate the website it queries Hubski for each post, scrapes the comments section, and then includes that in the static output. I get greater control over the output and I can style the Hubski comments consistently with the rest of my blog. The comments section won't update dynamically, but then after the initial flurry of comments they don't really change much anyway. It wouldn't be too hard to regenerate and deploy the site a day or a week after each new post so that visitors can see the latest from Hubski.
The new website is live as of today. It shouldn't look any different from how it used to, but the Hubski discussion should now be static and styled the same way as the rest of the site. I'm still tweaking how it looks (and lord knows there are probably some busted links), but what's there is basically working. I don't know if there's any demand for it, but if any other bloggers are using Pelican I'll gladly share the plugin I wrote.
Very cool. I think this trend makes sense for a lot of content creators. Good discussion requires so much more than a commenting widget, IMO. The rewrite includes an API, which might provide more options in this respect. Of course, this sort of thing only works for discussion sites that don't mind you posting everything you write. ;)
Hahah, this is true! Hubski is very forgiving of people pimping their own content, though I don't actually post everything I write — just the stuff that I think will be of interest. I typically don't post my own stuff to Reddit at all because they can turn on you faster than a tiger on Roy. Or was it Siegfried? At any rate, the comments on any given Reddit post reads like feeding time at the zoo. Comments on Hubski are a wee bit more sane, and they're the kind of thing I'd actually want to embed on my site. He'd probably kill me if he caught me saying this, but at one point my brother tried to promote something of his on Reddit. I've never had them eviscerate me quite like they eviscerated him. He got a handful of negative reviews, and I'm like 99% sure there's an official fatwah out on him now.