Skip to content

Bridgetown Integration

Bridgetown is a modern Ruby-based static site generator. This guide shows you how to add JamComments to your Bridgetown site. Before starting, you’ll need:

  • A JamComments account
  • A site created in your account
  • An API key (get one in your account settings)

Add the plugin to your Gemfile:

gem "bridgetown_jam_comments"

Then run bundle install.

Initialize the plugin in your config/initializers.rb:

Bridgetown.configure do |config|
init :bridgetown_jam_comments
end

You can set these values as environment variables:

VariableDescription
JAM_COMMENTS_DOMAINYour site’s domain (without “https://“)
JAM_COMMENTS_API_KEYYour API key from account settings
JAM_COMMENTS_ENVIRONMENT”production” or “development” (optional, defaults to BRIDGETOWN_ENV)

Or configure them directly in your initializer:

Bridgetown.configure do |config|
init :bridgetown_jam_comments
domain "your-site.com"
api_key "your-api-key"
environment "production" # or "development"
end
end

Or in your bridgetown.config.yml:

bridgetown_jam_comments:
domain: "your-site.com"
api_key: "your-api-key"
environment: "production" # or "development"

Add the {% jam_comments %} Liquid tag where you want comments to appear:

<div class="post">
<!-- Your post content -->
</div>
{% jam_comments %}

The plugin uses context["page"]["relative_url"] to determine the page path.

Override the default text in your config:

bridgetown_jam_comments:
domain: "your-site.com"
api_key: "your-api-key"
copy:
comment_placeholder: "Share your thoughts..."
submit_button: "Post Comment"
name_placeholder: "Your name"
PropertyDefault
confirmation_message”Comment successfully submitted!”
submit_button”Submit”
name_placeholder(empty)
email_placeholder(empty)
comment_placeholder”Write something in plain text or Markdown…”
write_tab”Write”
preview_tab”Preview”
auth_button”Log In or Register”
log_out_button”Log Out”
reply_button”Reply”
name_label”Name”
email_label”Email”

Found a bug or have an improvement? Open an issue or pull request on GitHub.