Project

yashare

0.0
No commit activity in last 3 years
No release in over 3 years
Add and customize Yandex Share buttons to your Rails app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.6.1, ~> 2.6
~> 3
~> 0.30

Runtime

 Project Readme

YaShare

Build Status Code Climate Test Coverage Gem Version

An Action View helper to add Yandex Share buttons to your Rails App.

Installation

Add this line to your application's Gemfile:

gem 'yashare'

And then execute:

$ bundle

Or install it yourself as:

$ gem install yashare

Usage

Use yashare helper in your view code to add the Yandex Share buttons to the page. Without parameters, this code

<%= yashare %>

will render the following HTML:

<script charset="utf-8" type="text/javascript" src="//yastatic.net/share/share.js"></script>
<div class="yashare-auto-init" data-yashareQuickServices="vkontakte,facebook,twitter,lj" data-yashareL10n="ru" data-yashareType="button"></div>

Supported options are: :services, :lang, :image, :type.

Use :services option to specify buttons for which services should be displayed. The default services are: :vkontakte, :facebook, :twitter, :lj. Supported services: :blogger, :delicious, :diary, :digg, :evernote, :facebook, :friendfeed, :gplus, :juick, :liveinternet, :linkedin, :lj, :moikrug, :moimir, :myspace, :odnoklassniki, :pinterest, :surfingbird, :tutby, :twitter, :vkontakte, :yazakladki.

<%= yashare(services: [:twitter, :facebook]) %>

Use :lang option to specify the language for the buttons. The default value is ru. Supported values: :az, :be, :en, :hy, :ka, :kk, :ro, :ru, :tr, :tt, :uk.

<%= yashare(lang: :ru) %>

Use :image option to specify the image for sharing on Pinterest. This option is useful only when :services option includes :pinterest.

<%= yashare(image: 'http://example.com/i/photo.jpg') %>

Use :type option to specify the appearance of the buttons. Default value is :button. Supported values: :small, :button, :link, :icon, :none.

<%= yashare(type: :small) %>

Read Yandex Share button documentation (in Russian) for more information.

Contributing

Your contribution is welcome.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request