fionawhim

Personal site of Fiona Hopkins. Coding, crafting, gaming, and queer shit.

Now with Comments!

1 December 2019

I rolled my own comment form using Firebase’s Cloud Firestore as the backend (and Akismet integration, so don’t try anything).

You can try it out below and at the bottom of most other posts.

I’m trying out doing this server-side rendered. The comments form POSTs to a Cloud Function hosted on Firebase that does the spam check, writes to the database, and triggers Netlify to re-publish the site.

My Gatsby blog theme then sources the nodes from the Firestore database so they can get added to each page.

I learned a good deal about Cloud Firestore — which I hadn’t used before — and combining Gatsby nodes from different sources together.

Does it work? Give it a go!


Comments

Post a Comment