Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

mattpolito/komments_gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby wrapper around the commenting engine, Komments (http://komments.net)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages