Comanche, the Comment Manager for static websites

Comanche is a Sinatra application to manage comments on a static website.

What is does

It is a lightweight and privacy-friendly alternative to Disqus, along the lines of Isso.

I wrote it as a quick hack to manage comments on my webpage.

The behavior is relatively simple. Comanche makes two routes publicly available, create and approved-comments. The first is used to submit a comment and the latter to retrieve all approved comments associated to a page. Both take as argument a unique identifier of the post; for my website, for instance, I use the path of the post.

Comments can be written in Markdown.

A back end allows to view, edit, and approve submitted posts. These are some screenshots, demonstrating the main functions of the backup (Viewing, editing, and approving comments):

Guiding Principles

Comanche is:

  • simple to install and run: the webapp is based on Sinatra; type rackup to start an instance of the application
  • privacy-friendly: no cookies, no tracking, no CDNs, no fingerprinting
  • does not require authentication to post comments: we trust visitors to be responsible
  • requires little or no JavaScript: comment submission happens through a standard form. Comment retrieval requires a call to the server; the template provides uses Ajax and Zepto (or jQuery).
  • simple to integrate with Jekyll websites: two ready-made templates are provided with the code; they can be included in your layouts
  • simple code base: this is the output of cloc

       $ cloc *.rb views/
        11 text files.
        11 unique files. 
         0 files ignored.
    
       github.com/AlDanial/cloc v 1.80  T=0.01 s (1771.7 files/s, 95347.1 lines/s)
       -------------------------------------------------------------------------------
       Language                     files          blank        comment           code
       -------------------------------------------------------------------------------
       Ruby                             4             76             17            292
       ERB                              7             16              0            191
       -------------------------------------------------------------------------------
       SUM:                            11             92             17            483
       -------------------------------------------------------------------------------
    

It is a relatively quick hack, which uses Spectre.css for layout and Zepto to manage the Ajax call required to retrieve posts from the webapp.

I expect Comanche to work best on websites with low traffic. The interface should be polished quite a bit to manage websites with tens of comments per post.

In the todo list: replies to comments (at the moment the structure of comments is flat) and the possibility of exporting approved comments to a YAML file, so that, for instance, one could publish approved comments without resorting to an Ajax call.

The code is available on Github: comanche repository. Give it a spin!

Get in touch

Comments