Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A plugin for Jekyll to implement a static-file based comments system
Jekyll::StaticComments is a Ruby plugin for Jekyll that replaces JavaScript-based comment systems with a static, file-based comment store that is rendered into each post at build time.
Jekyll::StaticComments is a plugin for the Jekyll static site generator that associates a _comments directory of YAML files with blog posts and exposes them to templates as page.comments. It takes YAML comment files, each containing a post_id field, and produces a list of Comment objects that pages can render. The plugin is open-source and licensed under the GNU General Public License version 3.
_comments directory, so there is no database and no JavaScript._comments directory can live anywhere in the site tree, including post-specific subdirectories.commentsubmit.php encodes form fields into YAML and emails them to the site owner for manual approval and placement.post_id, letting sites store nicknames, links, or custom data.This plugin is for Jekyll site owners who want comments without outsourcing them to Disqus or similar services. It suits developers who already manage their site as a git repository and are comfortable editing YAML files. It also works for bloggers who prefer an email-based moderation queue and do not need real-time discussion.
Install the static_comments.rb file into the _plugins directory, then add a comment form to your post template that points to commentsubmit.php. Place the PHP script and a thank-you page on your server; when a visitor submits a comment, the script emails the YAML-encoded fields to you. You then save that YAML into the _comments directory and regenerate the site, and the plugin exposes the comments to Liquid as page.comments at build time.
comment identifiers can be misinterpreted by Jekyll's parser and silently dropped.mailto: URL, taking static comments one step further by removing the PHP form._comments directory?It is a directory of YAML files that the plugin reads. Every file inside it is parsed as one comment; the directory can be placed anywhere in the Jekyll site and can have nested subdirectories.
The order of page.comments follows the lexical order of the comment filenames, so naming files by date and time preserves submission sequence.
Yes, only post_id is required. All other fields are mapped onto the Comment object and can be accessed in your Liquid templates.
No, it is a static workflow with email-based moderation. Comments appear only after the owner saves the YAML file into the _comments directory and rebuilds the site.
Yes, the plugin is licensed under the GNU General Public License version 3, so it is free to use and modify under the terms of that license.
