Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matt Fordham
committed
Nov 23, 2013
1 parent
93c35f0
commit 87061fb
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## Share ## | ||
### Facebook, Twitter, and Pinterest sharing made a little simpler. ### | ||
|
||
1. Include share.js | ||
2. Add these data attributes to your share links: `data-share-facebook`, `data-share-twitter`, `data-share-pinterest` | ||
3. Initialize the library: `Share.init()` | ||
4. Add some more data attributes to specifiy what gets shared (see below) | ||
|
||
### Data Attributes ### | ||
|
||
#### Facebook (simple) #### | ||
`data-share-link` The URL to share | ||
|
||
#### Facebook (advanced) #### | ||
`data-share-link` The URL to share | ||
`data-share-name` Name to use in share dialog | ||
`data-share-caption` Caption to use in share dialog | ||
`data-share-description` Description to use in share dialog | ||
`data-share-picture` Absolute URL to image to share | ||
|
||
#### Twitter #### | ||
`data-share-link` The URL to share | ||
`data-share-description` Text to share | ||
|
||
#### Pinterest #### | ||
`data-share-link` The URL to share | ||
`data-share-description` Text to share | ||
`data-share-picture` Absolute URL to image to share | ||
|
||
### Advanced Facebook Usage ### | ||
|
||
By default, the library will use the Facebook sharer URL (https://www.facebook.com/sharer/sharer.php?u=http://www.github.com). If you'd like more options, however, it can use the Facebook API's share dialog. To use this, initialize the library with the following options: | ||
|
||
``` | ||
Share.init({ | ||
facebookAppID: YOUR_APP_ID, | ||
facebookShareViaAPI: true | ||
}) | ||
``` |