Comments and Likes System
This blog uses a free Google Apps Script + Google Sheets backend for post comments and likes.
Files in this repo
One-time setup
- Create a Google Sheet with tabs named
comments,likes, and optionallysummary. - Open Apps Script from the Sheet or a standalone project.
- Paste the contents of scripts/comments-webapp.gs into the Apps Script editor.
- Set Script Properties:
SPREADSHEET_ID= your Google Sheet IDLIKES_SALT= any long random string
- Deploy as a web app:
- Execute as:
Me - Who has access:
Anyone
- Execute as:
- Copy the web app URL into
_config.ymlundercomments_api_url.
Moderation
- New comments are inserted as
pending. - Approve or reject comments directly in the Google Sheet by changing
statustoapprovedorspam. - The frontend only displays approved comments.
Notes
- The frontend uses simple GET and form-encoded POST requests to avoid unnecessary CORS preflight.
- If Google changes web app behavior, keep the GET endpoints for reads and form-encoded POST for writes.
- The summary tab is optional; the Apps Script can rebuild it on demand or via a daily trigger.