New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Staticman commenting system #427

Closed
binarymist opened this Issue Jan 1, 2018 · 11 comments

Comments

Projects
None yet
6 participants
@binarymist

binarymist commented Jan 1, 2018

Just wondering if you would like a PR for the following? To have @eduardoboucas Staticman as a first class commenting system would have saved me a lot of time. I'm hoping by contributing this, it may save many others the effort. Thoughts?

I've got staticman commenting working at binarymist.io/blog

Source: https://github.com/binarymist/BinaryMistBlog

The main files, and related changes required are:

Shout out if you need clarification around any of this.

Thanks.

@gcushen

This comment has been minimized.

Owner

gcushen commented Jan 2, 2018

Yes, feel free to submit a PR to add Staticman commenting. I'm not too familiar with Staticman, but I'll try to review the PR once it's submitted. Please try to keep it as simple as possible and add a screenshot or two to show what the PR adds to the page.

It's a shame it only works with GitHub hosted websites (see eduardoboucas/staticman#22 (comment)). Also, it's dependent on a third party server which all comment data goes through and is perhaps a lot more susceptible to going down than say Disqus.

@binarymist

This comment has been minimized.

binarymist commented Jan 3, 2018

How would you like me to do the CSS (sorry, I've updated the CSS link above to be more helpful)? Just use what I've got in my override.css. Check it on one of my blog posts. Feel free to leave some test comments if you would like to see what they look like, and test out the notify me functionality if you like.

It's a shame it only works with GitHub hosted websites

I don't think that's true. I've seen nothing to make me believe it wouldn't work on any static site. It does require github in order for staticman to submit the user comments as PR's though, I think that's where the confusion is. So long as you have a way for getting the comments from github into your source, then hugo will happily convert to md.

The process is all very easy. User subs a comment -> PR turns up in github from staticman -> site owner accepts or closes -> git pull -> hugo -> then I run the usual script -> clear my cdn cache and it's live.

I'll be writing a blog post around the entire process, you could possibly link to that, failing that, I'd be happy to provide some documentation in the form you require. Just let me know what that needs to look like. I'll make the blog post first, then sub PR of the code, then you can decide if you would like to just link to my blog post on it, or I can do something else for the docs. Will keep you posted.

@eduardoboucas

This comment has been minimized.

eduardoboucas commented Jan 3, 2018

Also, it's dependent on a third party server which all comment data goes through and is perhaps a lot more susceptible to going down than say Disqus.

Sorry to intrude, just wanted to point out that this server you mention is open-source, so even if the public instance went down for some reason, people could still run the server on their own infrastructure.

@binarymist

This comment has been minimized.

binarymist commented Jan 3, 2018

Exactly @eduardoboucas, all the data captured is sitting safely in git, beside the website. The website owner has full control. If/when the service did/does go down, it's possible for anyone to stand another up.

At this stage there are few free and open offerings for this sort of thing besides Disqus (which in my personal oppionin shouldn't even be an option). Disqus are invaders of privacy, which is why I spend a few days setting this up rather than dropping in Disqus. I struggle to stomach that the readers of my website are being abused, and from the offerings I reviewed, Staticman ticked all the free and open boxes.

I've also used a bot-pot, so that commenters are not made to jump through hoops with a problem that is not theirs (spam) as in captchas.

@binarymist

This comment has been minimized.

binarymist commented Jan 4, 2018

I've also just added a subscription that users can sub to, which simply adds their name and email to my mail list in mailgun (thanks @eduardoboucas). UI can be seen here: https://binarymist.io/post/

The email is md5'd in github, so the only person that can see it is the website owner in the mailgun account. The PR can be simply closed when the blog subscriber hits the subscribe button. I've tested sending notifications with a simple curl command to the mail list and it all works as expected, including the unsubscirbe link:

curl -s --user 'api:key-[the key goes here]' https://api.mailgun.net/v3/[my.domain]/messages -F from='Me myreplyemail@whateverdomain' -F to=[the-mail-list-hash]@[my.domain] -F subject='New Blog Post from BinaryMist' --form-string html='<html>Hi %recipient.name%.<br><br>This is a link to the new post: <a href="https://binarymist.io/blog/2017/10/02/the-cloud-shared-responsibility-model/">The Cloud Shared Responsibility Model</a><br><br> Enjoy!<br><br>-Me.<br><br><br>If at any point you would like to unsubscribe from this mailing list, click <a href="%mailing_list_unsubscribe_url%">Unsubscribe</a></html>'

Each user in the mailing list does need the name variable set, be nice if staticman could pass that through.

This only took a few hours once I had the other staticman comment subscription working.

@gcushen gcushen added the enhancement label Jan 5, 2018

@gcushen gcushen changed the title from Staticman as first class commenting to Add support for Staticman commenting system Jan 5, 2018

@petzi53

This comment has been minimized.

petzi53 commented Jul 13, 2018

I would like to support the integration of Staticman. I have collected some problems with the common alternative Disqus:

  • Disqus is slow and has a bad (re-)loading behaviour.
  • Disqus is tracking many different things for different customers; some of them hidden and unknown.
  • Disqus does not allow Markdown.
  • Disqus does not allow anonymous content (IP address, email and name is recorded).
  • Disqus is hosted in the USA which is considered to have less stricter privacy laws than Europe.
  • Disqus is not open source.
  • Disqus does not allow that user can use free licenses for their comments. It is not clear who has the ownership about the comments.
  • Disqus in one central authority collecting all comments of your website visitors and users on their servers.

I am a newcomer to hugo resp. on my rstudio/blogdown installation and I did not manage to install Staticman by myself. Therefore I really would appreciate the integration into the academic framework!

@binarymist

This comment has been minimized.

binarymist commented Jul 13, 2018

It may be that all the support required @petzi53 is to plus one the work I've already done which was sitting in PR #438 waiting to be merged. At this stage, @gcushen has stated that "This PR remains low priority".

Until such time that it's accepted, feel free to replicate the work I've done in my repo which I've provided hopefully complete details for in my blog post. If anything is unclear, please post a staticman comment on the post, and I can help you work through any struggles you may be facing.

Details in one of my books on Disqus. Hence why I opted for an open commenting system.

@vkehayas

This comment has been minimized.

Contributor

vkehayas commented Jul 13, 2018

@petzi53 I am happy to report that following @binarymist 's PR I was able to get comments to work on my website with a customized version of hugo academic. I just stripped the option to subscribe to comments, counting them, and the unrelated to staticman changes from the PR. Basically, you just need to copy his comments.html, academic.css, and single.html for any section you'd like to have comments on.

@petzi53

This comment has been minimized.

petzi53 commented Jul 16, 2018

Thank you @vkehayas and @binarymist for offering help and for your tips how should I proceed. I have to confess that I tried it out over the weekend, but did not succeed.

As soon as I have time to spare I will try it again, but this time with an example/test site and reporting in detail my steps and what kind of error messages my test site with the academic theme/framework has produced.

@gcushen

This comment has been minimized.

Owner

gcushen commented Nov 20, 2018

Closing this for now due to lack of suitable PR and lack of contributors who can develop and maintain it. Binarymist has written a blog post on how to perform the modification for anyone interested (linked in above comments).

@gcushen gcushen closed this Nov 20, 2018

@VincentTam

This comment has been minimized.

VincentTam commented Nov 24, 2018

"It's a shame it only works with GitHub hosted websites (see eduardoboucas/staticman#22 (comment)). Also, it's dependent on a third party server which all comment data goes through and is perhaps a lot more susceptible to going down than say Disqus."

Now Staticman supports GitLab. You may see my demo GitLab Pages at https://vincenttam.gitlab.io/bhdemo served by @staticmanlab.
Gitlab Staticman demo site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment