Staticman in jekyll leads to 405 “not allowed”

I tried to configure ‘staticman’ comments for my github pages. I use Beautiful Jekyll for my site.

I followed the documentation of staticman getting-started.

  1. created a github application and install it in my repo
  2. deploy staticman app on heroku
  3. configure _config.yml
  4. configure staticman.yml

Unfortunately I get only a HTTP 405 (not allowd) when I try to submit a comment. There does not arrive any request at my staticman installation. So I would guess this is a problem at github pages side.

Hello!

Any chances you can share with us the exact HTTP request that is failing?

GitHub Pages does not support verbs other than GET for instance. I suspect on your repo, staticman is trying to make non-GET requests against Pages instead of your Heroku app for some reasons.

If I try to to place a comment here having Developer Console open I saw that the form seem to sends the post request to itself.
I am not so good in jquery and javascript to understand what should happen instead. What I can say is that the jekyll rendering will work fine the staticman.js is loaded but my endpoint is never called from the form.

I have never used staticman but I think you are simply missing an action attribute on your form tag:

This should point to your staticman service (the one you deployed if following the documentation as a Heroku app). This is step 4 of the guide.

1 Like

Great advice but the jekyll theme (beautifuljekyll) do the trick by using jquery.js and staticman.js. So I would guess here the .submit should do the trick. No idea why this is not done.

I found an open bug on beautifuljekyll which describe the whole behavior. I’ll have an eye on it.