Code Monkey home page Code Monkey logo

nesta-plugin-sharethis's Introduction

Nesta::Plugin::Sharethis

Add ShareThis to NestaCMS.

Currently supported:

  • delicious
  • digg
  • dzone
  • email
  • facebook
  • facebook_like
  • google
  • google_reader
  • linkedin
  • reddit
  • tumblr
  • twitter

Installation

Add this line to your application's Gemfile:

gem 'nesta-plugin-sharethis'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nesta-plugin-sharethis

Usage

  1. Add share this configs.

     # file: config/config.yml
     sharethis: SHARETHIS_PARTENT_ID
    
     sharethis_buttons: # optional
     - :twitter
     - :linkedin
     - :reddit
     - :digg
     - :facebook_like
     # the aboce are the defaults
    

IMPORTANT: Notice the above sharethis_buttons are all Symbols -- meaning, they start with a colon (:) -- which is required.

See lib/nesta-plugin-sharethis/sharethis.yml for a full list.

If you would like to add more see the Overrides section below.

  1. Add the 'sharethis_javascript' helper to your your layout.haml:

     -#- file: views/layout.haml
     <!DOCTYPE html>
      %html(lang="en")
       %head
         %meta(charset="utf-8")
         - if @description
           %meta(name="description" content=@description)
         - if @keywords
           %meta(name="keywords" content=@keywords)
         = sharethis_javascript
         %title= @title
    
     -#- ... rest of layout.haml ...
    
  2. Add the 'sharethis_buttons' helper to your layout, where you want your buttons to appear.

     -#- file: views/layout.haml
    
     -#- ... rest of layout.haml ...
     = sharethis_buttons
     -#- ... rest of layout.haml ...
    

If you're using a theme like postal3, which already has share functionality, simply replace it's buttons with the helper above.

Overrides

To override defaults (see lib/nesta-plugin-sharethis/sharethis.yml) create a sharethis.yml file in your config directory and this plugin will merge it in to my defaults. Be sure to use the same format as my sharethis.yml.

Contributing

  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

nesta-plugin-sharethis's People

Contributors

jmervine avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.