My comment section is static HTML

12 points by jvalol


jvalol

The comment section under the post (not the lobste.rs one) is the mechanism the post describes, so view source shows the end result. If someone comments while you're reading, the page rebuilds and the comment is baked in about a minute later. Happy to answer questions about the server side.

Feels a bit recursive, now I think about it. Commenting about a novel commenting mechanism. Heh.

ryan-duve

I'd like to understand the decision to reach for solutions like Phoenix/Cowboy to serve a website such as this, instead of say Apache/NGINX. When I think of the BEAM I think of the need for lots and lots of concurrent messages, usually for some ultra dynamic system. I don't know how to reconcile that with the author's emphasis on static and simple characteristics.

sivers

For what it's worth, I generate static HTML comments using PostgreSQL's NOTIFY and LISTEN :

https://sive.rs/shc

The PostgreSQL function that receives the posted comment:

https://github.com/sivers/sivers/blob/master/me/comment_post.sql

Then then simple query to wrap comments in an ordered list:

https://github.com/sivers/sivers/blob/master/me/comments.sql

jmtd

So are mine: ikiwiki’s comments plugin works this way. The advantage ikiwiki has here, I think, is it’s had an optional dynamic component from day 1. (One of the disadvantages these days is it’s a setuid C wrapper to run Perl as the user who owns the source files, which is a lot of stuff you don’t need in the container era). Oh, and incremental builds.