All Projects → jekyll → jekyll-avatar

jekyll / jekyll-avatar

Licence: MIT license
A Jekyll plugin for rendering GitHub avatars

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to jekyll-avatar

Hanuman
A responsive, lightning-fast Jekyll theme built using AMP (Accelerated Mobile Pages) to speed up your blogs and websites.
Stars: ✭ 100 (+26.58%)
Mutual labels:  jekyll-plugin, github-pages
jekyll-default-layout
Silently sets default layouts for Jekyll pages and posts
Stars: ✭ 45 (-43.04%)
Mutual labels:  jekyll-plugin, github-pages
Pages Gem
A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
Stars: ✭ 1,670 (+2013.92%)
Mutual labels:  jekyll-plugin, github-pages
Jekyll Katex
Jekyll plugin for easy server-side math rendering via KaTeX
Stars: ✭ 73 (-7.59%)
Mutual labels:  jekyll-plugin, github-pages
Jekyll Remote Theme
Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
Stars: ✭ 188 (+137.97%)
Mutual labels:  jekyll-plugin, github-pages
Azkar-App
Desktop Application 💻 for Calculating Muslim prayer times 🕌 , Morning and Nights Azkar 🤲 with notification for random Azkar that pops-up in specific time.
Stars: ✭ 64 (-18.99%)
Mutual labels:  github-pages
agency-jekyll-theme
Jekyll version of the newest Agency Bootstrap theme, plus new features: Google Analytics, Markdown support, custom pages, and more!
Stars: ✭ 222 (+181.01%)
Mutual labels:  github-pages
portfolio
My Portfolio
Stars: ✭ 17 (-78.48%)
Mutual labels:  github-pages
jekyll-data
A plugin to read '_config.yml' and data files within Jekyll theme gems
Stars: ✭ 40 (-49.37%)
Mutual labels:  jekyll-plugin
Jekyll-Spotify
Easily output Spotify Embed Player for jekyll
Stars: ✭ 15 (-81.01%)
Mutual labels:  jekyll-plugin
status.im
Build a Better Web with Status
Stars: ✭ 137 (+73.42%)
Mutual labels:  github-pages
git clones
Git clone all of a user's PUBLIC Github repositories
Stars: ✭ 20 (-74.68%)
Mutual labels:  github-pages
universum-contracts
text-to-image generation gems / libraries incl. moonbirds, cyberpunks, coolcats, shiba inu doge, nouns & more
Stars: ✭ 17 (-78.48%)
Mutual labels:  avatars
eryajf.github.io
📝 大千世界,何其茫茫。谨此笔记,记录过往。凭君阅览,小站洛荒。如能收益,莫大奢望
Stars: ✭ 159 (+101.27%)
Mutual labels:  github-pages
angular-scaffolding
🔥 A seed project to help us get up & running with Progressive Web Apps, Google Analytics, Angular Universal, and be able to deploy to App Engine & GitHub Pages
Stars: ✭ 12 (-84.81%)
Mutual labels:  github-pages
bside
Github Content Management System
Stars: ✭ 22 (-72.15%)
Mutual labels:  github-pages
jekyll-theme-mint
A clean and responsive jekyll theme
Stars: ✭ 16 (-79.75%)
Mutual labels:  github-pages
iKevinY.github.io
Repository for my Pelican-powered website.
Stars: ✭ 21 (-73.42%)
Mutual labels:  github-pages
Wall-E
A modern jekyll theme with grid frontpage, beautiful typography, mobile responsive, made with Semantic UI
Stars: ✭ 38 (-51.9%)
Mutual labels:  github-pages
space-commit
The game where contributors become literal heroes! 🏆 Winner of the GitHub Actions Hackathon 2021
Stars: ✭ 37 (-53.16%)
Mutual labels:  github-pages

Jekyll Avatar

A Jekyll plugin for rendering GitHub avatars

CI

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. It even automatically upgrades users to Retina images, when supported.

Installation

Add the following to your site's Gemfile:

gem 'jekyll-avatar'

And add the following to your site's _config.yml file:

plugins:
  - jekyll-avatar

Note: If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

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:

<img class="avatar avatar-small" src="https://avatars3.githubusercontent.com/hubot?v=3&amp;s=40" alt="hubot" srcset="https://avatars3.githubusercontent.com/hubot?v=3&amp;s=40 1x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=80 2x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=120 3x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=160 4x" 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:

<img class="avatar" src="https://avatars3.githubusercontent.com/hubot?v=3&amp;s=50" alt="hubot" srcset="https://avatars3.githubusercontent.com/hubot?v=3&amp;s=50 1x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=100 2x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=150 3x, https://avatars3.githubusercontent.com/hubot?v=3&amp;s=200 4x" width="50" height="50" />

Passing the username as variable

You can also pass the username as a variable, like this:

{% assign user="hubot" %}
{% avatar {{ user }} %}

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 %}

Lazy loading images

For pages showing a large number of avatars, you may want to load the images lazily.

{% avatar hubot lazy=true %}

This will set the data-src and data-srcset attributes on the <img> tag, which is compatible with many lazy load JavaScript plugins, such as:

Using with GitHub Enterprise

To use Jekyll Avatars with GitHub Enterprise, you must set the PAGES_AVATARS_URL environmental variable.

This should be the full URL to the avatars subdomain or subpath. For example:

  • With subdomain isolation: PAGES_AVATARS_URL="https://avatars.github.example.com"
  • Without subdomain isolation: PAGES_AVATARS_URL="https://github.example.com/avatars"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].