First of all, if you haven't already, see the introduction in our landing page.
Already read it? Good!
Let's quickly go through how static site generators work in general.
We'll assume you're using Jekyll:
- You write blog posts in Markdown.
- You push your changes to a GitHub repository.
- Netlify compiles the Markdown files into HTML by invoking
- The static HTML files will be pushed to a CDN and your site is now live.
Since your website is fully static precompiled HTML, it loads fast, scales well, is SEO-friendly and cheap to host.
For the same benefits, Welcomments uses a very similar workflow for storing and displaying visitor comments on your website:
- A visitor writes a comment on your blog post.
- The comment form is posted to
- We validate, sanitize, check for spam, and do other necessary dances.
- The comment is turned into a JSON file and committed into the
_data/welcommentsdirectory of your GitHub repository.
- Netlify compiles your website with
jekyll build. All comment JSON files are compiled into static HTML inside the blog post HTML file.
- The static HTML files will be pushed to a CDN. Your site is now live, and the comments are pre-rendered HTML.
You get the usual benefits from having a static site, but for your comment section!