SaltyTron

Blog Update: Comments

August 18, 2020

Statically generated sites are great for blogs, because for the basic blog, there is almost no dynamic content. The biggest exception is comments: if you want users to be able to write comments on posts in a user-friendly way, then typically you’d have a form that they can enter comments into, and those comments would be stored in a database somewhere. With statically generated sites, there’s no database, so comments need their own system for storing information. Fortunately, there’s a fairly good open-source solution for providing an end-to-end experience for comments: Discourse.

Discourse for Blog Comments

Discourse is an open-source platform for discussion forums. Their main product is a hosted version that is fairly pricey, but it’s open source, so if you’re willing to put in a little extra time and learning, you can get your own Discourse server up with little cost. There’s also documentation for an easy docker install on a DigitalOcean host. The great thing about Discourse is that it’s easy to set up OAuth authentication, so people can sign in with Google, Facebook, Twitter, etc. It also has support for embedding on other sites, which is what you’d use to create a comments section on a blog post. For each page in which Discourse is embedded, it can create a topic thread, and then show that thread on the page. There’s also reasonably good documentation for embedding Discourse on sites.

Thoughts

Especially for a statically generated blog, Discourse seems like a great option. Disqus seems to be the most common platform for embedding comments in sites, but I’ve never seen a Disqus comment section that I liked. It always seemed too busy, especially if it was the add supported version. Discourse, on the other hand, has a clean look.

The only thing I don’t like as much about using Discourse for blog comments is that users can’t post comments directly on a blog post’s page. Instead, a link takes them to the forum site, where they can reply to the thread created for that post; but I like the easy login with Google, Facebook, etc., (and the login requirement– a big deterrent against spam comments.) I also like the fact that it’s open source. I may give an update on how I like it after someone actually tries to leave a comment.