Jekyll Integration
Jekyll is a legend of an SSG, laying the foundation of the Jamstack ecosystem even before “Jamstack” became a term. Its developer friendliness and low barrier to entry still make it a strong contender in the more “modern” era, making it an obvious one to decide to support for JamComments.
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 & Configuration
In your Jekyll site, install the plugin by running bundle add jekyll_jam_comments
or by adding the following to your Gemfile:
After doing so, set up the following environment variables for your site:
Syntax | Description |
---|---|
JAM_COMMENTS_DOMAIN | The domain for your site as configured in your account. Don’t include the protocol (“https”). |
JAM_COMMENTS_API_KEY | The API generated in your account settings. |
JAM_COMMENTS_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 JEKYLL_ENV . |
If you’d like to set these values within your config.yml
file, you may do so:
Usage
Place the {% jam_comments %}
Liquid tag on the page you’d like comments to appear. Under the hood, the plugin uses the page.url
context variable to determine the page path.
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.