I’ve been tying myself in knots over comments for a couple of weeks. This website’s built on Jekyll, a static site generator, which means there’s no way to send and fetch comments to and from a database or a set of files that live on this site.
However, the HTML
form element allows us to send data to a script or database located at the address specified in the
action attribute. Brilliant! That means it is possible to at least send data somewhere, even if it’s not this website. Couple that with the ability to read data from somewhere whenever the site is built, then you can maybe see a way to implement comments on a static site.
I’ve used this method in three ways:
- With Welcomments, which sends comments to your site repository and puts them in your
_datafolder to be read as a collection.
- By using Zapier to send the comments to Airtable, which offers an API that can be read when the site is built.
- By downloading comments from Netlify Forms in a
csvfile which can be used to create a collection.
While all these methods have done the job, they’ve not been without their problems and annoyances. Welcomments just stopped working altogether, while Airtable makes it very difficult to grab more than 100 comments. Downloading and editing a
csv file is laborious.
Perhaps I could implement a fallback? Perhaps wrap a plain comment form in a