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)
Installation
Section titled “Installation”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_commentsendConfiguration
Section titled “Configuration”You can set these values as environment variables:
| Variable | Description |
|---|---|
JAM_COMMENTS_DOMAIN | Your site’s domain (without “https://“) |
JAM_COMMENTS_API_KEY | Your 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" endendOr 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.
Customizing UI Text
Section titled “Customizing UI Text”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"| Property | Default |
|---|---|
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” |
Contributing
Section titled “Contributing”Found a bug or have an improvement? Open an issue or pull request on GitHub.