Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Static comment injector #160
While many goes to disqus to add comments to their blogs, I prefer having a static comment generator for my static websites written with Jekyll. The pros:
The cons: many, but I don't care.
On this website  dedicated to golang, I implemented this approach with Jekyll. Here an example of a post with comments . The workflow is as follow :
What do you think about this enhancement request?
I've been thinking about that since I knew about Hugo when I saw it in HN last week. I have a site that doesn't fit Disqus comments for the same reasons, SEO and durability of their platform, so I started browsing the code to see how could a comments processor be included.
I thought of the following workflow, that somehow resembles your proposal:
I think that having the option to comment in Hugo is very beneficial, as it frees you to depend on any external platform, and the fact that at least two people have been thinking about that gives a light on the need of this feature.
As I think about it there are really 3 common dynamic functions that websites offer:
Hugo already implements a relative high performance web server thanks to the great http serving functionality provided by the core go libraries.
I think we could easily provide each of these functionalities.
Contrasting the three:
I think the idea of adding a comment server is a good one, but I'm hopefully we can take a simpler approach than the one you describe with Jekyll. In some ways it's the most complicated one since it involves public writing.
Steps required for comments
I also think that this should be able to work independently of the server functionality. For instance I may want to serve pages statically, but have a single endpoint that is dynamic collecting input for comments, but me manually rebuild the site to include these content.
This also creates multimaster issues where writing can happen simultaneously in two places. The key here is to have additive user input where a conflict isn't possible.
I like this approach..
Should not be automatically added, but the responsibility of the template. We can provide a template that ships with Hugo that can be included in the single.html file as desired.
This makes sense to me. Append only file for easy conflict resolution.
Somewhat makes sense, but how often is someone going to ssh into the server to approve a comment. Probably better here is email that a comment happened with a random hash associated with it. Then provide an endpoint with that unique and obscure url that permits the author to approve or reject. Something like spf13.com/_/comment/5550c4148e91f5b1cdc4a552b6ece42caa4fc5e8
Overall I think this would be a great feature addition.
Yes, agree, I forgot to say that a new file should be added to the templates with the comment form that would be included to the generated page if comments are enabled.
Ok, the email option is right, I was thinking on the blogger that starts the server with the watch feature on. But one thing I don't really like are the obscure URL to manage approval or rejection, at least not without some authorization procedure.
Somehow in the future a light admin view could be added, that gives the option to edit online and review and approve comments? Might be something separated from Hugo too.
referenced this issue
Nov 9, 2014
As this issue is a closed issue, I post my reply in hugo discussion forum http://discuss.gohugo.io/t/static-comment-for-hugo/1944