FastComments.com

Add Comments to Your Jekyll Site

This is the official Jekyll Library for FastComments.

Embed live commenting, chat, and review widgets in your Jekyll site.

Repository

View on GitHub

Live Showcase Internal Link

To see every tag running locally against the public demo tenant, clone the repo and run:

cd example
bundle install
bundle exec jekyll serve

Each widget has its own page under example/ that you can copy straight into your own Jekyll site.

Install Internal Link

Gem

Add the gem to the :jekyll_plugins group in your site's Gemfile:

group :jekyll_plugins do
  gem "fastcomments-jekyll"
end

Then:

bundle install

(Compatible with Jekyll 3.7+ and 4.x.)

Tags Internal Link

TagDescription
fastcommentsLive commenting with replies, voting, moderation, and realtime updates
fastcomments_comment_countComment count for the current page
fastcomments_comment_count_bulkComment counts for many pages on one list/index page
fastcomments_live_chatRealtime streaming chat widget
fastcomments_collab_chatCollaborative inline commenting (text annotations)
fastcomments_image_chatImage annotation comments
fastcomments_recent_commentsRecent comments across the site
fastcomments_recent_discussionsRecently active discussion threads
fastcomments_reviews_summaryStar-rating reviews summary
fastcomments_top_pagesMost-discussed pages
fastcomments_user_activity_feedPer-user activity feed

Examples

{% raw %}{# Comment count. The widget renders its own label, e.g. "0 comments" #}
{% fastcomments_comment_count %}

{# Live chat #}
{% fastcomments_live_chat %}

{# Collab chat. Point it at a content element with a CSS selector #}
<article id="post-body">
  <p>Highlight me to leave a comment.</p>
</article>
{% fastcomments_collab_chat target="#post-body" %}

{# Image chat. Point it at an image element with a CSS selector #}
<img id="hero" src="/hero.jpg" alt="Hero image">
{% fastcomments_image_chat target="#hero" %}

{# Reviews summary #}
{% fastcomments_reviews_summary %}

{# User activity feed. Requires a user id #}
{% fastcomments_user_activity_feed user_id="demo:demo-user" %}

{# Bulk comment counts for a blog index #}
{% for post in site.posts %}
  <a href="\{{ post.url }}">\{{ post.title }}</a>
  <span class="fast-comments-count" data-fast-comments-url-id="\{{ post.url }}"></span>
{% endfor %}
{% fastcomments_comment_count_bulk %}{% endraw %}

Configuration Internal Link

Config comes from three places. Later sources win:

  1. Global defaults in _config.yml under the fastcomments: key.
  2. Page context, derived automatically for page-scoped widgets (see below).
  3. Tag attributes written on the tag itself.

So a url_id on the tag overrides the page-derived value, which overrides any global default.

Attribute syntax

Attributes are key=value pairs in snake_case:

{% raw %}{% fastcomments url_id="my-stable-id" readonly=true count=20 %}{% endraw %}
  • Quoted values ("..." or '...') are literal strings.
  • Unquoted true/false become booleans, and numbers become numbers.
  • Unquoted anything else is resolved as a Liquid variable from the page context, e.g. url_id=page.slug. (Liquid does not expand {% raw %}\{{ ... }}{% endraw %} inside a tag's attributes, so use the bare page.slug form rather than "{% raw %}\{{ page.slug }}{% endraw %}".)

Snake_case attribute and config keys are mapped automatically to the camelCase keys FastComments expects (tenant_idtenantId, url_idurlId, page_titlepageTitle, has_dark_backgroundhasDarkBackground, and so on). Any other option from the widget configuration passes straight through the same way.

Page-derived values

For the page-scoped widgets (fastcomments, fastcomments_comment_count, fastcomments_live_chat, fastcomments_collab_chat, fastcomments_image_chat) these are filled in automatically from the current page unless you set them yourself:

  • url_idpage.url (a stable identifier independent of the visiting domain)
  • urlsite.url + page.url (only when url is set in _config.yml)
  • page_titlepage.title

Site-wide widgets (recent comments/discussions, top pages, reviews summary, user activity feed, bulk count) are not tied to a page and do not derive these.

EU data residency

EU customers add region: eu, either globally:

fastcomments:
  tenant_id: your-tenant-id
  region: eu

or per tag: {% raw %}{% fastcomments region="eu" %}{% endraw %}. Widgets then load from the EU CDN.

Maintenance Status Internal Link

These components are wrappers around our core VanillaJS components. We can automatically update those components (fix bugs, add features) without publishing this library, so while it may not be published for a while that does not mean FastComments is not under active development! Feel free to check our blog for updates. Breaking API changes or features will never be shipped to the underlying core library without a version bump in this library.

Need Help?

If you encounter any issues or have questions about the Jekyll Library, please:

Contributing

Contributions are welcome! Please visit the GitHub repository for contribution guidelines.