Bridgetown Integration
Bridgetown.rb is a modern spin-off of the Jekyll static site generator, with a sophisticated & growing breadth of features that make it a great choice for buidling a content platform.
These instructions assume you’ve already created a JamComments account as well as a site within that account. If you haven’t, learn more about that process on the Getting Started page.
Installation
Section titled “Installation”In your Bridgetown site, install the plugin by running bundle add bridgetown_jam_comments or by adding the following to your Gemfile:
gem "bridgetown_jam_comments"After doing so, initialize the integration by adding the following to your config/initializers.rb file:
Bridgetown.configure do |config| # The rest of your site's configuration...
init :bridgetown_jam_commentsendConfiguration Values
Section titled “Configuration Values”The following variables are supported by the itegration:
| Syntax | Description |
|---|---|
domain | The domain for your site as configured in your account. Don’t include the protocol (“https”). |
api_key | The API generated in your account settings. |
environment | Setting this to development will cause “dummy” comments to be locally rendered, which is helpful for styling. By default, this will fall back to the value of BRIDGETOWN_ENV. |
There are a few different ways you can configure these.
Inside Your Initializer
Section titled “Inside Your Initializer”Bridgetown.configure do |config| # The rest of your site's configuration...
init :bridgetown_jam_comments domain "your.domain.com" api_key "123-api-key" environment "production" # or "development" (optional) endendEnvironment Variables
Section titled “Environment Variables”| Variable | Syntax |
|---|---|
domain | JAM_COMMENTS_DOMAIN |
api_key | JAM_COMMENTS_API_KEY |
environment | JAM_COMMENTS_ENVIRONMENT |
In Your Config File
Section titled “In Your Config File”bridgetown_jam_comments: domain: "your.domain.com" api_key: "123-api-key" environment: "production" # or 'development' (optional)Place the {% jam_comments %} Liquid tag on the page you’d like comments to appear. Under the hood, the plugin uses context["page"]["relative_url"] to determine the page path, which will be used to associate your comment to a post.
<div class="post"> <!-- content... --></div>
{% jam_comments %}Overridding Copy in UI
Section titled “Overridding Copy in UI”The JamComments UI comes with its own set of basic copy for its components (submission confirmation, submit button text, etc.). Many of this copy can be overridden with the copy prop.
| Property | Where It Appears | Default |
|---|---|---|
confirmation_message | In the success banner after submitting a comment. | ”Comment successfully submitted!” |
submit_button | In the comment submission button. | ”Submit” |
name_placeholder | In the “name” input. | (empty) |
email_placeholder | In the “email” input. | (empty) |
comment_placeholder | In the comment textarea. | ”Write something in plain text or Markdown…” |
write_tab | In the tab for composing a comment. | ”Write” |
preview_tab | In the tab for previewing a comment. | ”Preview” |
auth_button | In the link for signing in or registering. | ”Log In or Register” |
log_out_button | In the link for logging out. | ”Log Out” |
reply_button | In the reply button on each comment. | ”Reply” |
name_label | In the label for the name input. | ”Name” |
email_label | In the label for the email input. | ”Email” |
You can pass these values in the copy option:
bridgetown_jam_comments: domain: "your.domain.com" api_key: "123-api-key" environment: "production" # or 'development' (optional) copy: comment_placeholder: "Write something" submit_button: "Send it!", name_placeholder: "Ur Mom",Contributions
Section titled “Contributions”The source for this plugin is open to contributions. If you have a bug fix or idea for improvement, leave a pull request or issue in the GitHub repository.