Skip to content

Posting a comment without JavaScript

Chris Buckley edited this page Sep 18, 2019 · 2 revisions

Thanks to Staticman comment spam, I have had to enable reCAPTCHA on the blog.

I chose to use invisible reCAPTCHA, which is the least obtrusive to visitors when commenting, however it does require JavaScript to use. There is a <noscript> version of reCAPTCHA, but the invisible version is not supported. It seemed best to use the JavaScript version (but I added some tracking out of interest, which showed that no-one really visited the site without JavaScript enabled).

Posting without JavaScript

In order to post a comment, you'll need to do the job of Staticman yourself: create a pull request.

In the folder _data/comments, you can see a number of folders where the name matches the post's page.slug. If the post folder doesn't exist, you'll need to create the correct folder name.

You can then create a YAML file with any name, as long as the content is as follows:

name: Your Name
comment: Your comment
date: TIMESTAMP

In this, TIMESTAMP must be a Unix timestamp. A timestamp can be obtained from https://www.unixtimestamp.com/.

Once you've created this comment file, create a pull request!

Clone this wiki locally