README.md in jekyll-twitter-plugin-1.1.1 vs README.md in jekyll-twitter-plugin-1.2.0

- old
+ new

@@ -25,11 +25,10 @@ ### Requirements * Twitter oauth credentials - Most Twitter api functions now require authentication. Set up your [application](https://dev.twitter.com/apps/new) and get the credentials. - ### Usage As mentioned by [Jekyll's documentation](http://jekyllrb.com/docs/plugins/#installing-a-plugin) you have two options; manually import the source file or require the plugin as a `gem`. #### Require gem @@ -56,12 +55,26 @@ $ wget https://raw.githubusercontent.com/rob-murray/jekyll-twitter-plugin/master/lib/jekyll-twitter-plugin.rb ``` #### Credentials -Your Twitter application authentication credentials are private - do not distribute these! As such this plugin requires your credentials as Environment variables, it requires the following keys to be set; +Your Twitter application authentication credentials are private - do not distribute these! +You can set the authentication variables by adding them to `_config.yml`. + +```yaml +# _config.yml +twitter: + consumer_key: asdf + consumer_secret: asdf + access_token: asdf + access_token_secret: asdf +``` + +If the authentication variables are not present in `_config.yml` they can be gathered from +environment variables. + * TWITTER_CONSUMER_KEY * TWITTER_CONSUMER_SECRET * TWITTER_ACCESS_TOKEN * TWITTER_ACCESS_TOKEN_SECRET @@ -98,11 +111,11 @@ {% twitter oembed https://twitter.com/rubygems/status/518821243320287232 align='right' width='350' %} ``` ### Output -As with the original plugin, all content will be rendered inside a div with the classes 'embed' and 'twitter' +As with the original plugin, all content will be rendered inside a div with the classes 'embed' and 'twitter' ```html <div class='embed twitter'> -- content -- </div> @@ -113,13 +126,26 @@ > Tweet could not be processed ### Caching -TODO +Twitter API responses can be cached to speed up Jekyll site builds and avoid going over API limits. The reponses will be cached in a directory within your Jekyll project called `.tweet-cache`, ensure that this is not commit to source control. +Caching is enabled by default. +It is possible to disable caching by using the specific `twitternocache` tag. + +```liquid +{% twitternocache oembed status_url *options %} + +# Example +{% twitternocache oembed https://twitter.com/rubygems/status/518821243320287232 %} + +``` + ### Contributions + +I've tried hard to keep all classes and code in the one `lib/jekyll-twitter-plugin.rb` file so that people can just grab this file and include in their Jekyll `_plugins` directory if they do not want to use the Gem. This may have to be dropped if the one file gets too overwhelming. Please use the GitHub pull-request mechanism to submit contributions. ### License