Project

komments

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper around the commenting engine, Komments
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

Gem Version Code Climate

Ruby wrapper to get configured with the commenting engine, Komments

Installation

Add this line to your application's Gemfile:

gem 'komments'

And then execute:

bundle

Or install it yourself as:

gem install komments

Usage

Currently the main functionality of this library is to configure your api key so that your personalized site url can be generated.

To do this:

Komments.configure do |config|
  config.api_key = 'API_KEY_GOES_HERE'
end

Would be the most straight forward way to go about this. If this were being used in a Rails project, I would recommend putting this in your config/initializers directory.

Now that your credentials are out of the way, you'll be able to call:

Komments.website_url

This will provide your site's url to Komments. Add that to a script tag in your template and you will be good to go.

<script async="async" src=<%= Komments.website_url %>></script>

That will end up looking this this:

<script async="async" src="//komments.net/embed/{API_KEY_GOES_HERE}"></script>

Rails Usage

If you happen to be integrating Komments into your Rails application, you're covered as well.

When a Rails app is detected, you'll gain access to the komments_script_tag helper.

<%= komments_script_tag %>

Which will render out to:

<script async="async" src="//komments.net/embed/{API_KEY_GOES_HERE}"></script>

And if you don't want the script to be loaded asynchronously...

<%= komments_script_tag(false) %>

Which will render out to:

<script defer="defer" src="//komments.net/embed/{API_KEY_GOES_HERE}"></script>

Contributing

  1. Fork it ( https://github.com/[my-github-username]/komments/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request