Sha256: 45d479e7b99701ac45b34887819dd5d30d9e73b38616399020e659b4c1dec055
Contents?: true
Size: 1.59 KB
Versions: 4
Compression:
Stored size: 1.59 KB
Contents
# Jekyll Avatar *A Jekyll plugin for rendering GitHub avatars* [![Build Status](https://travis-ci.org/benbalter/jekyll-avatar.svg)](https://travis-ci.org/benbalter/jekyll-avatar) Jekyll Avatar makes it easy to add GitHub avatars to your Jekyll site by specifying a username. If performance is a concern, Jekyll Avatar is deeply integrated with the GitHub avatar API, ensuring avatars are cached and load in parallel. ## Installation Add the following to your site's `Gemfile`: ```ruby gem 'jekyll-avatar' ``` And add the following to your site's `_config.yml` file: ```yaml gems: - jekyll-avatar ``` ## Usage Simply add the following, anywhere you'd like a user's avatar to appear: ``` {% avatar [USERNAME] %} ``` With `[USERNAME]` being the user's GitHub username: ``` {% avatar hubot %} ``` That will output: ```html <img class="avatar avatar-small" src="https://avatars3.githubusercontent.com/hubot?v=3&s=40" alt="hubot" width="40" height="40" /> ``` ### Customizing You can customize the size of the resulting avatar by passing the size argument: ``` {% avatar hubot size=50 %} ``` That will output: ```html <img class="avatar" src="https://avatars3.githubusercontent.com/hubot?v=3&s=50" alt="hubot" width="50" height="50" /> ``` ### Passing the username as variable You can also pass the username as a variable, like this: ``` {% assign username="hubot" %} {% avatar {{ username }} %} ``` Or, if the variable is someplace a bit more complex, like a loop: ``` {% assign employees = "alice|bob" | split:"|" %} {% for employee in employees %} {% avatar user=employee %} {% endfor %} ```
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
jekyll-avatar-0.3.1 | README.md |
jekyll-avatar-0.3.0 | README.md |
jekyll-avatar-0.2.3 | README.md |
jekyll-avatar-0.2.2 | README.md |