JAMstack sites are often seen as being static. A more accurate mental model for them would be that they are sites which have the ability to be hosted statically. The difference might seem semantic, but thanks to the rise of many tools and services which simplify running a build and deploying to static hosting infrastructure, such sites can feel much fresher and dynamic than you might imagine, while still capable of being served from static hosting infrastructure, with all the benefits that brings.
A feature often used as an example of why a site cannot be hosted statically is comments. A comments engine needs to handle submissions, allow for moderation, and is by its very nature, “dynamic”.
Thanks to the growing ecosystem of tools available for JAMstack sites, there are solutions to this. Let’s looks at an example which you could use on your own site, which:
- Could work with any static site generator
- Includes moderation
- Sends notifications when new comments need moderating
- Bakes the comments into your site, so that they load quickly and appear in searches
This example makes use of some of the features of Netlify , a platform for automating, deploying and hosting web projects, but many of the principles could be used with other platforms.
Stashing our content
We’ll create 2 forms to receive all of our comments at the different stages of their journey from commenter to content. When Netlify sees a