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
In your Bridgetown site, install the plugin by running bundle add bridgetown_jam_comments
or by adding the following to your Gemfile:
After doing so, initialize the integration by adding the following to your config/initializers.rb
file:
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
Environment Variables
Variable | Syntax |
---|---|
domain | JAM_COMMENTS_DOMAIN |
api_key | JAM_COMMENTS_API_KEY |
environment | JAM_COMMENTS_ENVIRONMENT |
In Your Config File
Usage
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.
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” |
You can pass these values in the copy
option:
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.