Let the Commenting Commence―For Realzies This Time

Well I got comments working via Staticman, so that’s nice. 🍻 But I had a rather difficult time getting it to work and I’m not completely satisfied with this implementation. 🫠 A few things still niggle my brain and occupy my ToDo list, including but necessarily limited to:

  1. I couldn’t get it to work with my site being published on CloudflarePages.
    • For me, it has only worked while published on GitHub Pages. Seems like it might have something to do with the JEKYLL_ENV=production option, but that is speculation and inadmissible to the court. Here’s the comment on GitHub which is the basis for my speculation.
    • When I tried to get it working while published on CloudflarePages, after I had it running happily on GitHub Pages so I knew it was working, I could get it to partially work (comment form showing up) but when I corrected the repo in _config.yml it broke in strange new ways. The theme stopped working and all the links broke, including the links for any posts. I sure haven’t been able to make sense of that.
  2. I would like to get threaded comments working.
  3. No Mailgun or reCaptcha for now. Hopefullly that portion of the config is simple now that I have the basic funtionality in place 🤞
  4. I would like to tweak the comment form but things feel a bit precarious still so I’m reluctant to try. I guess that is what branches are for? ¯\_(ツ)_/¯

Some notes for fellow travelers that find themselves following a similar path (this includes Future-Nate):

  • Staticman v3 works with MinimalMistakes but the config was not intuitive to me and the documentation felt a little unclear. 🤏 Probably the documentation would have been fine if I’d been deploying on GitHub Pages or GitLab Pages but since I was using CloudflarePages all of my troubleshooting was maddening and made me question every speck of documentation I could find. 🧐
    • For the comment provider, one still sets it to staticman_v2 in one’s _config.yml. ✅
    • However, for the endpoint one uses the v3 style url. ✅
    • I put the snippet from my config that works with Staticman v3 at the end of this post because a multi-line code block kept breaking my list or the indentation in the snippet. If anyone knows how to do a multi-line code block as a list item in MarkDown such that the indentation in said snippet gets preserved, let me know, you can even just use the comment form now 😜
    • For the staticman.yml file I included githubAuth.clientId & githubAuth.clientSecret with a secret for each encrypted via Staticman as documented here. ✅
    • My Staticman instance is hosted on Heroku leveraging a personal fork of the official Staticman repo and a private GitHub app installed in my site’s repo.
      • My Staticman instance on Heroku spins down when idle with log messages like the following, which were concerning until I read closer and saw the bit about Idling 🔍
      2022-08-13T04:34:01.650009+00:00 heroku[web.1]: Idling
      2022-08-13T04:34:01.652984+00:00 heroku[web.1]: State changed from up to down
      2022-08-13T04:34:04.163849+00:00 heroku[web.1]: Stopping all processes with SIGTERM
      2022-08-13T04:34:04.239238+00:00 app[web.1]: Error waiting for process to terminate: No child processes
      2022-08-13T04:34:04.397821+00:00 heroku[web.1]: Process exited with status 22
      

This is probably where I’ll leave things for a while. I’m glad to have things (mostly) working how I’d like.

But first, the code snippet as promised:

repository: "nfugal/nfugal.github.io" # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes"
comments:
  provider: "staticman_v2"
  staticman:
    branch: "main"
    endpoint: https://staticman.<herokuinstance>/v3/entry/github/



Remember, if something hasn’t gone wrong yet, you’re not trying hard enough.

-Nate